From: Jim Meyering Date: Sat, 3 Dec 2005 23:24:46 +0000 (+0000) Subject: (print_uptime): Move decl of local `upsecs' into scope where it's used. X-Git-Tag: v6.0~1215 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a936ac291c4a5b3e7eb6e3ace9731fde40488440;p=thirdparty%2Fcoreutils.git (print_uptime): Move decl of local `upsecs' into scope where it's used. --- diff --git a/src/uptime.c b/src/uptime.c index 5118956ea4..da8618e28d 100644 --- a/src/uptime.c +++ b/src/uptime.c @@ -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);