commit 7ffe3cfacce716b08139c8713f37fd38b4bce6f7
Author:     parazyd <[email protected]>
AuthorDate: Fri Dec 28 07:49:54 2018 -0500
Commit:     sin <[email protected]>
CommitDate: Wed Jan 30 11:25:33 2019 +0000

    uptime: Fix user/s printing (grammar error) when users == 0.
    
    Signed-off-by: parazyd <[email protected]>

diff --git a/uptime.c b/uptime.c
index e0dd6fa..3979964 100644
--- a/uptime.c
+++ b/uptime.c
@@ -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",

Reply via email to