From: Jaromir Capik Date: Thu, 2 Jan 2014 17:21:31 +0000 (+0100) Subject: library: fixing uninitialized variable 'pos' in whattime.c X-Git-Tag: v3.3.10~121 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=38cbeedeb7dc94c95482343e547addc1748344b0;p=procps-ng library: fixing uninitialized variable 'pos' in whattime.c --- diff --git a/proc/whattime.c b/proc/whattime.c index 9d6abb30..eb345fb1 100644 --- a/proc/whattime.c +++ b/proc/whattime.c @@ -58,6 +58,8 @@ char *sprint_uptime(int human_readable) { realtime = localtime(&realseconds); pos = sprintf(buf, " %02d:%02d:%02d ", realtime->tm_hour, realtime->tm_min, realtime->tm_sec); + } else { + pos = 0; } /* read and calculate the amount of uptime */