[hackers] [ubase] uptime: Fix user/s printing (grammar error) when users == 0. || parazyd

From: <git_AT_suckless.org>
Date: Wed, 30 Jan 2019 12:25:43 +0100 (CET)

commit 7ffe3cfacce716b08139c8713f37fd38b4bce6f7
Author: parazyd <parazyd_AT_dyne.org>
AuthorDate: Fri Dec 28 07:49:54 2018 -0500
Commit: sin <sin_AT_2f30.org>
CommitDate: Wed Jan 30 11:25:33 2019 +0000

    uptime: Fix user/s printing (grammar error) when users == 0.
    
    Signed-off-by: parazyd <parazyd_AT_dyne.org>

diff --git a/uptime.c b/uptime.c
index e0dd6fa..3979964 100644
--- a/uptime.c
+++ b/uptime.c
_AT_@ -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
_AT_@ -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",
Received on Wed Jan 30 2019 - 12:25:43 CET

This archive was generated by hypermail 2.3.0 : Wed Jan 30 2019 - 12:36:22 CET