]> mj.ucw.cz Git - ywho.git/blobdiff - ywho.c
Updated the LSM
[ywho.git] / ywho.c
diff --git a/ywho.c b/ywho.c
index 0b4670e6ae250c1f3807a51c32239f3284c6cf2e..821b491081510bfb9d7577f4a36129305f8280d6 100644 (file)
--- a/ywho.c
+++ b/ywho.c
@@ -1,7 +1,7 @@
 /*
- *     Extended `who' command, version 1.11.
+ *     Extended `who' command, version 1.12.
  *
- *     (c) 1996--2003 Martin Mares <mj@ucw.cz>
+ *     (c) 1996--2010 Martin Mares <mj@ucw.cz>
  *
  *     This software may be freely distributed and used according to the terms
  *     of the GNU General Public License. See file COPYING in any of the GNU packages.
@@ -256,13 +256,10 @@ line1(void)
     }
 
   {
-    struct tm *tm;
-    char *days[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
     now = time(NULL);
-    tm = localtime(&now);
-    printf(" on %s %02d-%02d-%02d %02d.%02d:%02d", days[tm->tm_wday], tm->tm_mday, tm->tm_mon+1,
-          tm->tm_year%100, tm->tm_hour, tm->tm_min, tm->tm_sec);
-    printf(" (%u UE)\n", (unsigned int) now);
+    struct tm *tm = localtime(&now);
+    strftime(line, sizeof(line), "%a %Y-%m-%d %H.%M:%S", tm);
+    printf(" on %s\n", line);
   }
 }
 
@@ -326,7 +323,7 @@ line2(void)
          printf(" of swap");
        }
     }
-  printf(", %d user%s.\n", usercnt, usercnt == 1 ? "" : "s");
+  printf(", %d user%s\n", usercnt, usercnt == 1 ? "" : "s");
 }
 
 static void