]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
utmpdump: code formatting for readability
authorRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 1 Dec 2016 08:52:07 +0000 (09:52 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 7 Dec 2016 11:35:24 +0000 (12:35 +0100)
BTW avoid using the defined sizes.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
login-utils/utmpdump.c

index 8f438b00112b546e0dae370fd812863a76c2d67a..4a85afa7daddde4f91aa7fa66a8121073aae5686 100644 (file)
@@ -112,10 +112,12 @@ static void print_utline(struct utmp *ut, FILE *out)
        cleanse(ut->ut_line);
        cleanse(ut->ut_host);
 
-       /*            pid    id       user     line     host     addr       time */
+       /*            type pid    id       user     line     host     addr    time */
        fprintf(out, "[%d] [%05d] [%-4.4s] [%-*.*s] [%-*.*s] [%-*.*s] [%-15s] [%s]\n",
-              ut->ut_type, ut->ut_pid, ut->ut_id, 8, UT_NAMESIZE, ut->ut_user,
-              12, UT_LINESIZE, ut->ut_line, 20, UT_HOSTSIZE, ut->ut_host,
+              ut->ut_type, ut->ut_pid, ut->ut_id,
+              8, (int)sizeof(ut->ut_user), ut->ut_user,
+              12, (int)sizeof(ut->ut_line), ut->ut_line,
+              20, (int)sizeof(ut->ut_host), ut->ut_host,
               addr_string, time_string);
 }