diff lib/strftime.c @ 726:8867c987f8cf

(strftime): Accommodate the broken C compiler that comes with SunOS -- don't initialize aggregates in decls of automatic variables. Reported by Kaveh Ghazi.
author Jim Meyering <jim@meyering.net>
date Thu, 10 Oct 1996 02:56:10 +0000 (1996-10-10)
parents 6813ffe12e6a
children 70c419102365
line wrap: on
line diff
--- a/lib/strftime.c
+++ b/lib/strftime.c
@@ -658,8 +658,11 @@
 
 	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 @@
 	    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)
 	      {