uptime: Fix user/s printing (grammar error) when users == 0.

Signed-off-by: parazyd <parazyd@dyne.org>
This commit is contained in:
parazyd 2018-12-28 07:49:54 -05:00 committed by sin
parent 604b66ae8b
commit 7ffe3cfacc
1 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ main(int argc, char *argv[])
hours = info.uptime % 24;
days = info.uptime / 24;
if (days)
printf("%d day%s, ", days, days > 1 ? "s" : "");
printf("%d day%s, ", days, days != 1 ? "s" : "");
if (hours)
printf("%2d:%02d, ", hours, minutes);
else
@ -61,7 +61,7 @@ main(int argc, char *argv[])
if (ferror(ufp))
eprintf("%s: read error:", UTMP_PATH);
fclose(ufp);
printf(" %d user%s, ", nusers, nusers > 1 ? "s" : "");
printf(" %d user%s, ", nusers, nusers != 1 ? "s" : "");
}
printf(" load average: %.02f, %.02f, %.02f\n",