]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
chfn: new_fields: fix wrong fields printed
authorSerge Hallyn <serge@hallyn.com>
Thu, 22 Dec 2022 23:54:51 +0000 (17:54 -0600)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Fri, 23 Dec 2022 08:04:02 +0000 (09:04 +0100)
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>
src/chfn.c

index 1c2f1cce0455532b494b63dd4bffff586caf639f..b1793e18390f0c1bbd55b40a0dd6f0e150049055 100644 (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) {