From 07592f31be3927dd1e9e6a4d82e4049c52cde48c Mon Sep 17 00:00:00 2001 From: sin Date: Tue, 25 Mar 2014 12:38:47 +0000 Subject: [PATCH] Print system login processes correctly when doing who -l Fix style as well. --- who.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/who.c b/who.c index f05cf54..c46a6ac 100644 --- a/who.c +++ b/who.c @@ -49,9 +49,9 @@ main(int argc, char **argv) if (!*usr.ut_name || !*usr.ut_line || usr.ut_line[0] == '~') continue; - if (mflag && strcmp(usr.ut_line, tty)) + if (mflag != 0 && strcmp(usr.ut_line, tty) != 0) continue; - if (strcmp(usr.ut_name, "LOGIN") == lflag) + if (!!strcmp(usr.ut_name, "LOGIN") == lflag) continue; t = usr.ut_time; strftime(timebuf, sizeof timebuf, "%Y-%m-%d %H:%M", localtime(&t)); @@ -60,4 +60,3 @@ main(int argc, char **argv) fclose(ufp); return EXIT_SUCCESS; } -