BSD 4_4_Lite1 release
[unix-history] / usr / src / usr.bin / w / pr_time.c
index 689d340..87fffb3 100644 (file)
@@ -1,5 +1,5 @@
 /*-
 /*-
- * Copyright (c) 1990, 1993
+ * Copyright (c) 1990, 1993, 1994
  *     The Regents of the University of California.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  *     The Regents of the University of California.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -32,7 +32,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)pr_time.c  8.1 (Berkeley) 6/6/93";
+static char sccsid[] = "@(#)pr_time.c  8.2 (Berkeley) 4/4/94";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -49,7 +49,7 @@ static char sccsid[] = "@(#)pr_time.c 8.1 (Berkeley) 6/6/93";
  *     Print the time since the user logged in. 
  *
  *     Note: SCCS forces the bizarre string manipulation, things like
  *     Print the time since the user logged in. 
  *
  *     Note: SCCS forces the bizarre string manipulation, things like
- *     8.1 get replaced in the source code.
+ *     8.2 get replaced in the source code.
  */
 void
 pr_attime(started, now)
  */
 void
 pr_attime(started, now)
@@ -69,14 +69,12 @@ pr_attime(started, now)
 
        /* If not today, use day-hour-am/pm. */
        else if (*now / SECSPERDAY != *started / SECSPERDAY) {
 
        /* If not today, use day-hour-am/pm. */
        else if (*now / SECSPERDAY != *started / SECSPERDAY) {
-               (void)strcpy(fmt, "%a%%%p");
-               fmt[3] = 'I';
+               (void)strcpy(fmt, __CONCAT("%a%", "I%p"));
        }
 
        /* Default is hh:mm{am,pm}. */
        else {
        }
 
        /* Default is hh:mm{am,pm}. */
        else {
-               (void)strcpy(fmt, "%l:%%%p");
-               fmt[4] = 'M';
+               (void)strcpy(fmt, __CONCAT("%l:%", "M%p"));
        }
 
        (void)strftime(buf, sizeof(buf), fmt, tp);
        }
 
        (void)strftime(buf, sizeof(buf), fmt, tp);