Fix some warnings from pvs-studio

This commit is contained in:
Todd C. Miller
2020-08-12 13:45:09 -06:00
parent fb8ed8ba66
commit 961a4afe67
45 changed files with 330 additions and 314 deletions

View File

@@ -55,7 +55,7 @@ linux_audit_open(void)
if (errno == EINVAL || errno == EPROTONOSUPPORT || errno == EAFNOSUPPORT)
au_fd = AUDIT_NOT_CONFIGURED;
else
sudo_warn(U_("unable to open audit system"));
sudo_warn("%s", U_("unable to open audit system"));
} else {
(void)fcntl(au_fd, F_SETFD, FD_CLOEXEC);
}
@@ -98,7 +98,7 @@ linux_audit_command(char *const argv[], int result)
/* Log command, ignoring ECONNREFUSED on error. */
if (audit_log_user_command(au_fd, AUDIT_USER_CMD, command, NULL, result) <= 0) {
if (errno != ECONNREFUSED) {
sudo_warn(U_("unable to send audit message"));
sudo_warn("%s", U_("unable to send audit message"));
goto done;
}
}