chfn: new_fields: fix wrong fields printed

When the caller may not change the room number, work phone, or
home number, then rather than prompting for the new one it will
print the existing one.  But due to a typo it printed the full name
in place of each of those.

Fix the fields being printed.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
This commit is contained in:
Serge Hallyn 2022-12-22 17:54:51 -06:00 committed by Iker Pedrosa
parent eb164165f6
commit bc18c184e5

View File

@ -175,19 +175,19 @@ static void new_fields (void)
if (may_change_field ('r')) {
change_field (roomno, sizeof roomno, _("Room Number"));
} else {
printf (_("\t%s: %s\n"), _("Room Number"), fullnm);
printf (_("\t%s: %s\n"), _("Room Number"), roomno);
}
if (may_change_field ('w')) {
change_field (workph, sizeof workph, _("Work Phone"));
} else {
printf (_("\t%s: %s\n"), _("Work Phone"), fullnm);
printf (_("\t%s: %s\n"), _("Work Phone"), workph);
}
if (may_change_field ('h')) {
change_field (homeph, sizeof homeph, _("Home Phone"));
} else {
printf (_("\t%s: %s\n"), _("Home Phone"), fullnm);
printf (_("\t%s: %s\n"), _("Home Phone"), homeph);
}
if (amroot) {