fputs(USAGE_SEPARATOR, fp);
printf( " -u, --help %s\n", USAGE_OPTSTR_HELP);
printf( " -v, --version %s\n", USAGE_OPTSTR_VERSION);
- fprintf(fp, USAGE_MAN_TAIL("chfn(1)"));
+ printf(USAGE_MAN_TAIL("chfn(1)"));
exit(EXIT_SUCCESS);
}
status += check_gecos_string(_("Home Phone"), optarg);
break;
case 'v':
- printf(UTIL_LINUX_VERSION);
- exit(EXIT_SUCCESS);
+ print_version(EXIT_SUCCESS);
case 'u':
usage();
default:
ctl->newf.other);
/* remove trailing empty fields (but not subfields of ctl->newf.other) */
- if (!ctl->newf.other) {
+ if (!ctl->newf.other || !*ctl->newf.other) {
while (len > 0 && gecos[len - 1] == ',')
len--;
gecos[len] = 0;
setlocale(LC_ALL, ""); /* both for messages and for iscntrl() below */
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
- atexit(close_stdout);
+ close_stdout_atexit();
+
uid = getuid();
/* check /etc/login.defs CHFN_RESTRICT */