2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 01:49:11 +00:00

Prefer putchar over fputc where possible

putchar is easier to understand than fputc and printf and does less work than those two do.
This commit is contained in:
Rose 2024-01-12 13:10:17 -05:00 committed by Todd C. Miller
parent 7fc7d69532
commit 725d3fdc20
2 changed files with 7 additions and 7 deletions

View File

@ -940,14 +940,14 @@ qprintf(const char *str, Char *s)
(void)printf("%s:\n", str);
for (p = s; *p; p++)
(void)fputc(CHAR(*p), stdout);
(void)fputc('\n', stdout);
(void)putchar(CHAR(*p));
(void)putchar('\n');
for (p = s; *p; p++)
(void)fputc(*p & M_PROTECT ? '"' : ' ', stdout);
(void)fputc('\n', stdout);
(void)putchar(*p & M_PROTECT ? '"' : ' ');
(void)putchar('\n');
for (p = s; *p; p++)
(void)fputc(ismeta(*p) ? '_' : ' ', stdout);
(void)fputc('\n', stdout);
(void)putchar(ismeta(*p) ? '_' : ' ');
(void)putchar('\n');
}
#endif /* DEBUG */
#endif /* HAVE_GLOB */

View File

@ -315,7 +315,7 @@ dump_entry(struct timestamp_entry *entry, off_t pos)
} else if (entry->type == TS_PPID) {
printf("parent pid: %d\n", (int)entry->u.ppid);
}
fputc('\n', stdout);
putchar('\n');
debug_return;
}