changeset 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
parents ea86caa7c2cc
children a0fde96fa851
files lib/strftime.c
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
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)
 	      {