diff options
Diffstat (limited to 'usr.bin/w/pr_time.c')
-rw-r--r-- | usr.bin/w/pr_time.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/w/pr_time.c b/usr.bin/w/pr_time.c index ba94b50..1a50fdc 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) |