In the human_readable case; otherwise the strcat() that follows may
append bytes to the previous contents of buf.
Also, slightly enlarge buf, as it was a bit too tight.
Could also replace all sprintf()s with snprintf()s, but all the calls
here output a limited number of characters, so they should be safe.
#include "whattime.h"
#include "sysinfo.h"
-static char buf[128];
+static char buf[256];
static double av[3];
char *sprint_uptime(int human_readable) {
realtime->tm_hour, realtime->tm_min, realtime->tm_sec);
} else {
pos = 0;
+ buf[0] = '\0';
}
/* read and calculate the amount of uptime */