]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lastlog: fix alignment of Latest header
authorTodd Zullinger <tmz@pobox.com>
Tue, 18 Jul 2023 03:16:00 +0000 (23:16 -0400)
committerSerge Hallyn <serge@hallyn.com>
Tue, 18 Jul 2023 15:49:13 +0000 (10:49 -0500)
b1282224 (Add maximum padding to fit IPv6-Addresses, 2020-05-24) pads
the From field header using `maxIPv6Addrlen - 3`.  This leaves the
Latest field header misaligned.  Subtract 4 (the length of "From").

src/lastlog.c

index 6b96197409a0dc9c8aef45c1d59dde4a39fdf074..1db668871b36fbb8504d52c5f14e11604a22a7e0 100644 (file)
@@ -143,7 +143,7 @@ static void print_one (/*@null@*/const struct passwd *pw)
        /* Print the header only once */
        if (!once) {
 #ifdef HAVE_LL_HOST
-               printf (_("Username         Port     From%*sLatest\n"), maxIPv6Addrlen-3, " ");
+               printf (_("Username         Port     From%*sLatest\n"), maxIPv6Addrlen-4, " ");
 #else
                puts (_("Username                Port     Latest"));
 #endif