summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDima Ruban <dima@FreeBSD.org>1995-09-22 00:50:37 +0000
committerDima Ruban <dima@FreeBSD.org>1995-09-22 00:50:37 +0000
commit89cc2fabf225b522d8e25db3c96e4a5eecf74b48 (patch)
treead3706723114aec8704e0f06daa7fd36e97e1da0
parentaee3c74900eae7366f404f17136bd0e7437a3725 (diff)
Notes
-rw-r--r--usr.bin/w/pr_time.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/w/pr_time.c b/usr.bin/w/pr_time.c
index ba94b50ae070..1a50fdcfebb4 100644
--- a/usr.bin/w/pr_time.c
+++ b/usr.bin/w/pr_time.c
@@ -89,8 +89,10 @@ pr_idle(idle)
time_t idle;
{
/* If idle more than 36 hours, print as a number of days. */
- if (idle >= 36 * 3600)
- (void)printf(" %ddays ", idle / 86400);
+ if (idle >= 36 * 3600) {
+ int days = idle / 86400;
+ (void)printf(" %dday%s ", days, days > 1 ? "s" : "" );
+ }
/* If idle more than an hour, print as HH:MM. */
else if (idle >= 3600)