From: Jim Meyering Date: Thu, 10 Oct 1996 02:56:10 +0000 (+0000) Subject: (strftime): Accommodate the broken C compiler X-Git-Tag: TEXTUTILS-1_19n~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5e9f3ee5d2776d1f2ca360da7526c02e33ade4b;p=thirdparty%2Fcoreutils.git (strftime): Accommodate the broken C compiler that comes with SunOS -- don't initialize aggregates in decls of automatic variables. Reported by Kaveh Ghazi. --- diff --git a/lib/strftime.c b/lib/strftime.c index aa97c02ce1..de6a0d427f 100644 --- a/lib/strftime.c +++ b/lib/strftime.c @@ -658,8 +658,11 @@ strftime (s, maxsize, format, tp) case 's': /* GNU extension. */ { - struct tm ltm = *tp; - time_t t = mktime (<m); + struct tm ltm; + time_t t; + + ltm = *tp; + t = mktime (<m); /* Generate string value for T using time_t arithmetic; this works even if sizeof (long) < sizeof (time_t). */ @@ -803,8 +806,11 @@ strftime (s, maxsize, format, tp) diff = tp->tm_gmtoff; #else struct tm gtm; - struct tm ltm = *tp; - time_t lt = mktime (<m); + struct tm ltm; + time_t lt; + + ltm = *tp; + lt = mktime (<m); if (lt == (time_t) -1) {