(strftime): Accommodate the broken C compiler
authorJim Meyering <jim@meyering.net>
Thu, 10 Oct 1996 02:56:10 +0000 (02:56 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 10 Oct 1996 02:56:10 +0000 (02:56 +0000)
that comes with SunOS -- don't initialize aggregates in decls of
automatic variables.  Reported by Kaveh Ghazi.

lib/strftime.c

index aa97c02..de6a0d4 100644 (file)
@@ -658,8 +658,11 @@ strftime (s, maxsize, format, tp)
 
        case 's':               /* GNU extension.  */
          {
-           struct tm ltm = *tp;
-           time_t t = mktime (&ltm);
+           struct tm ltm;
+           time_t t;
+
+           ltm = *tp;
+           t = mktime (&ltm);
 
            /* 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 (&ltm);
+           struct tm ltm;
+           time_t lt;
+
+           ltm = *tp;
+           lt = mktime (&ltm);
 
            if (lt == (time_t) -1)
              {