Replace printf by puts for fixed strings. This would avoid issues caused

by formats introduced in translated strings.
This commit is contained in:
nekral-guest 2008-01-24 21:07:14 +00:00
parent 8c229ea473
commit 28a9441f4f
7 changed files with 15 additions and 14 deletions

View File

@ -5,9 +5,10 @@
src/userdel.c, src/lastlog.c, src/groupmems.c, src/usermod.c, src/userdel.c, src/lastlog.c, src/groupmems.c, src/usermod.c,
src/expiry.c, src/groupdel.c, src/useradd.c, src/su.c, src/expiry.c, src/groupdel.c, src/useradd.c, src/su.c,
src/groupmod.c, src/passwd.c, src/groupadd.c, src/login.c, src/groupmod.c, src/passwd.c, src/groupadd.c, src/login.c,
src/suauth.c, src/faillog.c, src/id.c: Replace src/suauth.c, src/faillog.c, src/id.c, libmisc/limits.c,
printf by puts for fixed strings. This would avoid issues caused libmisc/addgrps.c, libmisc/env.c, libmisc/age.c, libmisc/yesno.c,
by formats introduced in translated strings. lib/getdef.c: Replace printf by puts for fixed strings. This would
avoid issues caused by formats introduced in translated strings.
2008-01-23 Nicolas François <nicolas.francois@centraliens.net> 2008-01-23 Nicolas François <nicolas.francois@centraliens.net>

View File

@ -257,8 +257,8 @@ int putdef_str (const char *name, const char *value)
* Save off the value. * Save off the value.
*/ */
if ((cp = strdup (value)) == NULL) { if ((cp = strdup (value)) == NULL) {
fprintf (stderr, fputs (_("Could not allocate space for config info.\n"),
_("Could not allocate space for config info.\n")); stderr);
SYSLOG ((LOG_ERR, "could not allocate space for config info")); SYSLOG ((LOG_ERR, "could not allocate space for config info"));
return -1; return -1;
} }

View File

@ -64,7 +64,7 @@ int add_groups (const char *list)
continue; continue;
if (ngroups >= sysconf (_SC_NGROUPS_MAX)) { if (ngroups >= sysconf (_SC_NGROUPS_MAX)) {
fprintf (stderr, _("Warning: too many groups\n")); fputs (_("Warning: too many groups\n"), stderr);
break; break;
} }
tmp = (gid_t *) realloc (grouplist, (ngroups + 1) * sizeof (GETGROUPS_T)); tmp = (gid_t *) realloc (grouplist, (ngroups + 1) * sizeof (GETGROUPS_T));

View File

@ -68,13 +68,13 @@ int expire (const struct passwd *pw, const struct spwd *sp)
case 0: case 0:
return 0; return 0;
case 1: case 1:
printf (_("Your password has expired.")); puts (_("Your password has expired."));
break; break;
case 2: case 2:
printf (_("Your password is inactive.")); puts (_("Your password is inactive."));
break; break;
case 3: case 3:
printf (_("Your login has expired.")); puts (_("Your login has expired."));
break; break;
} }
@ -168,8 +168,8 @@ void agecheck (const struct passwd *pw, const struct spwd *sp)
("Your password will expire in %ld days.\n"), ("Your password will expire in %ld days.\n"),
remain); remain);
else if (remain == 1) else if (remain == 1)
printf (_("Your password will expire tomorrow.\n")); puts (_("Your password will expire tomorrow.\n"));
else if (remain == 0) else if (remain == 0)
printf (_("Your password will expire today.\n")); puts (_("Your password will expire today.\n"));
} }
} }

View File

@ -152,7 +152,7 @@ void addenv (const char *string, const char *value)
environ = __newenvp; environ = __newenvp;
newenvp = __newenvp; newenvp = __newenvp;
} else { } else {
fprintf (stderr, _("Environment overflow\n")); fputs (_("Environment overflow\n"), stderr);
free (newenvp[--newenvc]); free (newenvp[--newenvc]);
} }
} }

View File

@ -410,7 +410,7 @@ void setup_limits (const struct passwd *info)
if (info->pw_uid != 0) if (info->pw_uid != 0)
if (setup_user_limits (info->pw_name) & if (setup_user_limits (info->pw_name) &
LOGIN_ERROR_LOGIN) { LOGIN_ERROR_LOGIN) {
fprintf (stderr, _("Too many logins.\n")); fputs (_("Too many logins.\n"), stderr);
sleep (2); sleep (2);
exit (1); exit (1);
} }

View File

@ -55,7 +55,7 @@ int yes_or_no (int read_only)
* In read-only mode all questions are answered "no". * In read-only mode all questions are answered "no".
*/ */
if (read_only) { if (read_only) {
printf (_("No\n")); puts (_("No\n"));
return 0; return 0;
} }