diff options
author | ache <ache@FreeBSD.org> | 2001-03-21 21:49:33 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2001-03-21 21:49:33 +0000 |
commit | 75dff8d8708d93cbe2a37cec5b75c7e531d6ada8 (patch) | |
tree | 10d5cbfef92f6ea322ea5eb0b5629b2a814d3f88 | |
parent | 761a62d3aa6b0e5659f546c113706f2b5f996cfd (diff) | |
download | FreeBSD-src-75dff8d8708d93cbe2a37cec5b75c7e531d6ada8.zip FreeBSD-src-75dff8d8708d93cbe2a37cec5b75c7e531d6ada8.tar.gz |
Fix width for printing time
-rw-r--r-- | usr.bin/w/pr_time.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/w/pr_time.c b/usr.bin/w/pr_time.c index 5f77cf6..5596108 100644 --- a/usr.bin/w/pr_time.c +++ b/usr.bin/w/pr_time.c @@ -74,17 +74,16 @@ pr_attime(started, now) tm.tm_year != tp.tm_year) { /* The line below does not take DST into consideration */ /* else if (*now / 86400 != *started / 86400) { */ - (void)strcpy(fmt, use_ampm ? "%a%I%p" : "%a%H "); + (void)strcpy(fmt, use_ampm ? "%a%I%p" : "%a%H"); } /* Default is hh:mm{am,pm}. */ else { - (void)strcpy(fmt, use_ampm ? "%l:%M%p" : "%k:%M "); + (void)strcpy(fmt, use_ampm ? "%l:%M%p" : "%k:%M"); } - (void)strftime(buf, sizeof(buf) - 1, fmt, &tp); - buf[sizeof(buf) - 1] = '\0'; - (void)printf("%s", buf); + (void)strftime(buf, sizeof(buf), fmt, &tp); + (void)printf("%-7.7s", buf); } /* |