xstrncpy(orig_file, PASSWD_FILE, sizeof(orig_file));
}
- while ((c = getopt_long(argc, argv, "Vh", longopts, NULL)) != -1)
+ while ((c = getopt_long(argc, argv, "Vh", longopts, NULL)) != -1) {
switch (c) {
case 'V':
print_version(EXIT_SUCCESS);
default:
errtryhelp(EXIT_FAILURE);
}
+ }
edit_file(0);
- if (program == VIGR) {
- strncpy(orig_file, SGROUP_FILE, FILENAMELEN - 1);
- } else {
- strncpy(orig_file, SHADOW_FILE, FILENAMELEN - 1);
- }
+ if (program == VIGR)
+ xstrncpy(orig_file, SGROUP_FILE, sizeof(orig_file));
+ else
+ xstrncpy(orig_file, SHADOW_FILE, sizeof(orig_file));
if (access(orig_file, F_OK) == 0) {
char response[80];