diff options
author | H.Merijn Brand <h.m.brand@xs4all.nl> | 2012-02-14 09:17:02 +0100 |
---|---|---|
committer | H.Merijn Brand <h.m.brand@xs4all.nl> | 2012-02-14 09:17:02 +0100 |
commit | 28c8e5e38346920e93159862a479a40934c18c54 (patch) | |
tree | 9d3ff35644dd25705f67f428529d22bf988b910f | |
parent | a58a85fab78d767203f1dac26cbf0717d0c47e87 (diff) | |
download | perl-28c8e5e38346920e93159862a479a40934c18c54.tar.gz |
mixing declarations and assignments not allowed in C89
-rw-r--r-- | ext/POSIX/POSIX.xs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index 34e712ed56..945c34564f 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -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); |