From d83321388d5bd6c4d99ae7d8a84b59145eb539c2 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 20 Nov 2021 09:40:06 -0700 Subject: [PATCH] Quiet a PVS Studio warning. The warning that need_comma is always false is correct but in this case it is better to use a consistent construct so that if the code is re-ordered no bugs are introduced. --- plugins/sudoers/cvtsudoers_csv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sudoers/cvtsudoers_csv.c b/plugins/sudoers/cvtsudoers_csv.c index 1c3da190d..bcfa28d9f 100644 --- a/plugins/sudoers/cvtsudoers_csv.c +++ b/plugins/sudoers/cvtsudoers_csv.c @@ -456,7 +456,7 @@ print_cmndspec_csv(FILE *fp, struct sudoers_parse_tree *parse_tree, if (len == 0 || timebuf[sizeof(timebuf) - 1] != '\0') { sudo_warnx("%s", U_("unable to format timestamp")); } else { - fprintf(fp, "%snotbefore=%s", need_comma ? "," : "", timebuf); + fprintf(fp, "%snotbefore=%s", need_comma ? "," : "", timebuf); // -V547 need_comma = true; } }