]> granicus.if.org Git - procps-ng/commitdiff
library: Add space after days for uptime
authorCraig Small <csmall@enc.com.au>
Mon, 7 Sep 2015 08:38:39 +0000 (18:38 +1000)
committerCraig Small <csmall@enc.com.au>
Mon, 7 Sep 2015 08:38:39 +0000 (18:38 +1000)
Uptime output for both w and uptime command were showing no
comma or space after days.

$ ./uptime
 18:32:21 up 22 days7 min,  6 users,  load average: 0.23, 0.46, 0.64

Minor tweak to fix this.

proc/uptime.c

index ca571b9d752ff4ab01578d0ddd0c4633f493b8cb..e64120522bba85ea46055e197419980508325c19 100644 (file)
@@ -125,7 +125,7 @@ PROCPS_EXPORT char *procps_uptime_sprint(void)
         realtime->tm_hour, realtime->tm_min, realtime->tm_sec);
 
     if (updays)
-        pos += sprintf(upbuf + pos, "%d %s", updays, (updays > 1) ? "days" : "day");
+        pos += sprintf(upbuf + pos, "%d %s", updays, (updays > 1) ? "days" : "day");
 
     if (uphours)
         pos += sprintf(upbuf + pos, "%2d:%02d, ", uphours, upminutes);