]> granicus.if.org Git - procps-ng/commitdiff
library: fixing uninitialized variable 'pos' in whattime.c
authorJaromir Capik <jcapik@redhat.com>
Thu, 2 Jan 2014 17:21:31 +0000 (18:21 +0100)
committerJaromir Capik <jcapik@redhat.com>
Thu, 2 Jan 2014 17:21:31 +0000 (18:21 +0100)
proc/whattime.c

index 9d6abb3041c82003f28141540112fe353c61c464..eb345fb1c371dd53b31930eb5683aa7ea979be1e 100644 (file)
@@ -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 */