Skip to content

Commit

Permalink
Standardize on fprintf() rather than printf()
Browse files Browse the repository at this point in the history
The first one was added in:
    2008-04-25 Tarsnap 1.0.0
    41f175d
while the second one was added in:
    2013-07-13 Tarsnap 1.0.34
    8c34f3e

Other than those two cases, the only uses of printf() in c files in the
source tree is recrypt/recrypt.c and tests/valgrind/potential-memleaks.c.
  • Loading branch information
gperciva committed Jan 28, 2025
1 parent 60ecee0 commit 49e1974
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tar/bsdtar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,8 @@ usage(struct bsdtar *bsdtar)
static void
version(void)
{
printf("tarsnap %s\n", PACKAGE_VERSION);

fprintf(stdout, "tarsnap %s\n", PACKAGE_VERSION);
exit(0);
}

Expand Down Expand Up @@ -1410,7 +1411,8 @@ long_help(struct bsdtar *bsdtar)
fflush(stderr);

p = (strcmp(prog, "tarsnap") != 0) ? "(tarsnap)" : "";
printf("%s%s: create and manipulate archives on the Tarsnap backup service\n", prog, p);
fprintf(stdout, "%s%s: create and manipulate archives on the "
"Tarsnap backup service\n", prog, p);

for (p = long_help_msg; *p != '\0'; p++) {
if (*p == '%') {
Expand Down

0 comments on commit 49e1974

Please sign in to comment.