From 89cc2fabf225b522d8e25db3c96e4a5eecf74b48 Mon Sep 17 00:00:00 2001 From: Dima Ruban Date: Fri, 22 Sep 1995 00:50:37 +0000 Subject: Print "1day" instead of "1days" --- usr.bin/w/pr_time.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'usr.bin/w') diff --git a/usr.bin/w/pr_time.c b/usr.bin/w/pr_time.c index ba94b50ae0706..1a50fdcfebb4d 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) -- cgit v1.3