summaryrefslogtreecommitdiffstats
path: root/usr.bin/w/pr_time.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/w/pr_time.c')
-rw-r--r--usr.bin/w/pr_time.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/w/pr_time.c b/usr.bin/w/pr_time.c
index 6faf6db..c48f6a7 100644
--- a/usr.bin/w/pr_time.c
+++ b/usr.bin/w/pr_time.c
@@ -76,7 +76,8 @@ pr_attime(started, now)
(void)strcpy(fmt, __CONCAT("%l:%", "M%p"));
}
- (void)strftime(buf, sizeof(buf), fmt, tp);
+ (void)strftime(buf, sizeof(buf) - 1, fmt, tp);
+ buf[sizeof(buf) - 1] = '\0';
(void)printf("%s", buf);
}
OpenPOWER on IntegriCloud