]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(print_uptime): Move decl of local `upsecs' into scope where it's used.
authorJim Meyering <jim@meyering.net>
Sat, 3 Dec 2005 23:24:46 +0000 (23:24 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 3 Dec 2005 23:24:46 +0000 (23:24 +0000)
src/uptime.c

index 5118956ea4f528f63ee282e4d8bdaa0bcfe7ed60..da8618e28d315abe01a4057516ed0066cc17e634 100644 (file)
@@ -59,7 +59,6 @@ print_uptime (size_t n, const STRUCT_UTMP *this)
   int loads;
 #ifdef HAVE_PROC_UPTIME
   FILE *fp;
-  double upsecs;
 
   fp = fopen ("/proc/uptime", "r");
   if (fp != NULL)
@@ -69,7 +68,7 @@ print_uptime (size_t n, const STRUCT_UTMP *this)
       if (b == buf)
        {
          char *end_ptr;
-         upsecs = c_strtod (buf, &end_ptr);
+         double upsecs = c_strtod (buf, &end_ptr);
          if (buf != end_ptr)
            uptime = (0 <= upsecs && upsecs < TYPE_MAXIMUM (time_t)
                      ? upsecs : -1);