aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorPhilippe Charnier <charnier@FreeBSD.org>2003-09-07 16:31:32 +0000
committerPhilippe Charnier <charnier@FreeBSD.org>2003-09-07 16:31:32 +0000
commit69fe77ce99d22158d0d9c6f7dd69faffb049b8d0 (patch)
tree278620a6ef2aad6c02202df50d7660971d5f0554 /usr.bin
parent3f22597838c3b74ccf3bea8b2a6526aa0652c6bf (diff)
Notes
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/w/w.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c
index 8bf63d1573882..ebf2a87096d47 100644
--- a/usr.bin/w/w.c
+++ b/usr.bin/w/w.c
@@ -432,11 +432,9 @@ pr_header(time_t *nowp, int nusers)
/*
* Print time of day.
*/
- (void)strftime(buf, sizeof(buf) - 1,
- use_ampm ? "%l:%M%p" : "%k:%M", localtime(nowp));
- buf[sizeof(buf) - 1] = '\0';
- (void)printf("%s ", buf);
-
+ if (strftime(buf, sizeof(buf),
+ use_ampm ? "%l:%M%p" : "%k:%M", localtime(nowp)) != 0)
+ (void)printf("%s ", buf);
/*
* Print how long system has been up.
* (Found by looking getting "boottime" from the kernel)