From: Greg Beaver Date: Sun, 1 Mar 2009 06:58:23 +0000 (+0000) Subject: MFB: fix swapping of time/date in timestamp saving for zip, which can cause crash... X-Git-Tag: php-5.4.0alpha1~191^2~4213 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dd5cd94476ebaf238fa30c8aaf3a26a68e257b36;p=php MFB: fix swapping of time/date in timestamp saving for zip, which can cause crash on windows --- diff --git a/ext/phar/zip.c b/ext/phar/zip.c index 71a35b11d6..1409b65248 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -147,8 +147,8 @@ static void phar_zip_u2d_time(time_t time, char *dtime, char *ddate) /* {{{ */ struct tm *tm, tmbuf; tm = php_localtime_r(&time, &tmbuf); - ctime = ((tm->tm_year+1900-1980)<<9) + ((tm->tm_mon+1)<<5) + tm->tm_mday; - cdate = ((tm->tm_hour)<<11) + ((tm->tm_min)<<5) + ((tm->tm_sec)>>1); + cdate = ((tm->tm_year+1900-1980)<<9) + ((tm->tm_mon+1)<<5) + tm->tm_mday; + ctime = ((tm->tm_hour)<<11) + ((tm->tm_min)<<5) + ((tm->tm_sec)>>1); PHAR_SET_16(dtime, ctime); PHAR_SET_16(ddate, cdate); }