From 01f9705dd5e8f3220e4f4df6afe1226c8c5d48fa Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Thu, 24 Jan 2008 19:38:06 +0000 Subject: [PATCH] Replace printf by puts for fixed strings. This would avoid issues caused by formats introduced in translated strings. --- ChangeLog | 3 ++- src/grpck.c | 8 ++++---- src/pwck.c | 8 ++++---- src/sulogin.c | 6 +++--- src/vipw.c | 4 ++-- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 959c58d8..5d3f21ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2008-01-24 Nicolas François - * src/gpasswd.c, src/chfn.c, src/chage.c, src/chsh.c: Replace + * src/gpasswd.c, src/chfn.c, src/chage.c, src/chsh.c, src/grpck.c, + src/vipw.c, src/pwck.c, src/sulogin.c: Replace printf by puts for fixed strings. This would avoid issues caused by formats introduced in translated strings. diff --git a/src/grpck.c b/src/grpck.c index 5d0de45a..8d05b6e0 100644 --- a/src/grpck.c +++ b/src/grpck.c @@ -416,7 +416,7 @@ static void check_grp_file (int *errors, int *changed) * Tell the user this entire line is bogus and ask * them to delete it. */ - printf (_("invalid group file entry\n")); + puts (_("invalid group file entry\n")); printf (_("delete line '%s'? "), gre->line); *errors += 1; @@ -476,7 +476,7 @@ static void check_grp_file (int *errors, int *changed) * Tell the user this entry is a duplicate of * another and ask them to delete it. */ - printf (_("duplicate group entry\n")); + puts (_("duplicate group entry\n")); printf (_("delete line '%s'? "), gre->line); *errors += 1; @@ -604,7 +604,7 @@ static void check_sgr_file (int *errors, int *changed) * Tell the user this entire line is bogus and ask * them to delete it. */ - printf (_("invalid shadow group file entry\n")); + puts (_("invalid shadow group file entry\n")); printf (_("delete line '%s'? "), sge->line); *errors += 1; @@ -664,7 +664,7 @@ static void check_sgr_file (int *errors, int *changed) * Tell the user this entry is a duplicate of * another and ask them to delete it. */ - printf (_("duplicate shadow group entry\n")); + puts (_("duplicate shadow group entry\n")); printf (_("delete line '%s'? "), sge->line); *errors += 1; diff --git a/src/pwck.c b/src/pwck.c index 9990de1d..29a4383f 100644 --- a/src/pwck.c +++ b/src/pwck.c @@ -276,7 +276,7 @@ static void check_pw_file (int *errors, int *changed) * Tell the user this entire line is bogus and ask * them to delete it. */ - printf (_("invalid password file entry\n")); + puts (_("invalid password file entry\n")); printf (_("delete line '%s'? "), pfe->line); *errors += 1; @@ -335,7 +335,7 @@ static void check_pw_file (int *errors, int *changed) * Tell the user this entry is a duplicate of * another and ask them to delete it. */ - printf (_("duplicate password entry\n")); + puts (_("duplicate password entry\n")); printf (_("delete line '%s'? "), pfe->line); *errors += 1; @@ -487,7 +487,7 @@ static void check_spw_file (int *errors, int *changed) * Tell the user this entire line is bogus and ask * them to delete it. */ - printf (_("invalid shadow password file entry\n")); + puts (_("invalid shadow password file entry\n")); printf (_("delete line '%s'? "), spe->line); *errors += 1; @@ -546,7 +546,7 @@ static void check_spw_file (int *errors, int *changed) * Tell the user this entry is a duplicate of * another and ask them to delete it. */ - printf (_("duplicate shadow password entry\n")); + puts (_("duplicate shadow password entry\n")); printf (_("delete line '%s'? "), spe->line); *errors += 1; diff --git a/src/sulogin.c b/src/sulogin.c index 99efc781..4ccd574a 100644 --- a/src/sulogin.c +++ b/src/sulogin.c @@ -121,7 +121,7 @@ static RETSIGTYPE catch_signals (unused int sig) } } if (access (PASSWD_FILE, F_OK) == -1) { /* must be a password file! */ - printf (_("No password file\n")); + puts (_("No password file\n")); #ifdef USE_SYSLOG SYSLOG (LOG_WARN, "No password file\n"); closelog (); @@ -147,7 +147,7 @@ static RETSIGTYPE catch_signals (unused int sig) if (getppid() == 1) { setsid(); if (ioctl(0, TIOCSCTTY, 1)) - fprintf(stderr,_("TIOCSCTTY failed")); + fputs (_("TIOCSCTTY failed"), stderr); } while (*envp) /* add inherited environment, */ addenv (*envp++, NULL); /* some variables change later */ @@ -171,7 +171,7 @@ static RETSIGTYPE catch_signals (unused int sig) /* * Fail secure */ - printf (_("No password entry for 'root'\n")); + puts (_("No password entry for 'root'\n")); #ifdef USE_SYSLOG SYSLOG (LOG_WARN, "No password entry for 'root'\n"); closelog (); diff --git a/src/vipw.c b/src/vipw.c index 59490709..e58acb96 100644 --- a/src/vipw.c +++ b/src/vipw.c @@ -66,7 +66,7 @@ static void vipwedit (const char *, int (*)(void), int (*)(void)); */ static void usage (void) { - fprintf (stderr, _("Usage: vipw [options]\n" + fputs (_("Usage: vipw [options]\n" "\n" "Options:\n" " -g, --group edit group database\n" @@ -74,7 +74,7 @@ static void usage (void) " -p, --passwd edit passwd database\n" " -q, --quiet quiet mode\n" " -s, --shadow edit shadow or gshadow database\n" - "\n")); + "\n"), stderr); exit (E_USAGE); }