mixing declarations and assignments not allowed in C89
authorH.Merijn Brand <h.m.brand@xs4all.nl>
Tue, 14 Feb 2012 08:17:02 +0000 (09:17 +0100)
committerH.Merijn Brand <h.m.brand@xs4all.nl>
Tue, 14 Feb 2012 08:17:02 +0000 (09:17 +0100)
ext/POSIX/POSIX.xs

index 34e712e..945c345 100644 (file)
@@ -1969,9 +1969,10 @@ strptime(str, fmt, sec=-1, min=-1, hour=-1, mday=-1, mon=-1, year=-1, wday=-1, y
            if(tm.tm_mday > -1 && tm.tm_mon > -1 && tm.tm_year > -1) {
                /* if we leave sec/min/hour == -1, then these will be
                 * normalised to the previous day */
-               int was_sec  = tm.tm_sec;  tm.tm_sec  = 0;
-               int was_min  = tm.tm_min;  tm.tm_min  = 0;
-               int was_hour = tm.tm_hour; tm.tm_hour = 0;
+               int was_sec, was_min, was_hour;
+               was_sec  = tm.tm_sec;  tm.tm_sec  = 0;
+               was_min  = tm.tm_min;  tm.tm_min  = 0;
+               was_hour = tm.tm_hour; tm.tm_hour = 0;
 
                if(mktime(&tm) == (time_t)-1)
                    XSRETURN(0);