com php-src: fixed copying of the struct as it's not being modified: Zend/zend_virtual_cwd.c
| From: | Anatol Belski | Date: | Sat, 20 Sep 2014 18:58:00 +0000 |
| Subject: | com php-src: fixed copying of the struct as it's not being modified: Zend/zend_virtual_cwd.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81813@lists.php.net to get a copy of this message | ||
Commit: 2fc1a1dce557875d029f16d58bd3d4cd22af54fb
Author: Anatol Belski <ab@php.net> Sat, 20 Sep 2014 20:58:00 +0200
Parents: b9677d313d4c3e41282ad7e270a11a8891822437
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2fc1a1dce557875d029f16d58bd3d4cd22af54fb
Log:
fixed copying of the struct as it's not being modified
in the subsequent function call
Changed paths:
M Zend/zend_virtual_cwd.c
Diff:
diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c
index 9f5a74a..1a577d1 100644
--- a/Zend/zend_virtual_cwd.c
+++ b/Zend/zend_virtual_cwd.c
@@ -205,15 +205,15 @@ typedef struct {
#define SECS_BETWEEN_EPOCHS (__int64)11644473600
#define SECS_TO_100NS (__int64)10000000
-static inline time_t FileTimeToUnixTime(const FILETIME FileTime)
+static inline time_t FileTimeToUnixTime(const FILETIME *FileTime)
{
__int64 UnixTime;
long *nsec = NULL;
SYSTEMTIME SystemTime;
- FileTimeToSystemTime(&FileTime, &SystemTime);
+ FileTimeToSystemTime(FileTime, &SystemTime);
- UnixTime = ((__int64)FileTime.dwHighDateTime << 32) +
- FileTime.dwLowDateTime;
+ UnixTime = ((__int64)FileTime->dwHighDateTime << 32) +
+ FileTime->dwLowDateTime;
UnixTime -= (SECS_BETWEEN_EPOCHS * SECS_TO_100NS);
@@ -397,9 +397,9 @@ CWD_API int php_sys_stat_ex(const char *path, zend_stat_t *buf, int lstat) /* {{
t = t << 32;
t |= data.nFileSizeLow;
buf->st_size = t;
- buf->st_atime = FileTimeToUnixTime(data.ftLastAccessTime);
- buf->st_ctime = FileTimeToUnixTime(data.ftCreationTime);
- buf->st_mtime = FileTimeToUnixTime(data.ftLastWriteTime);
+ buf->st_atime = FileTimeToUnixTime(&data.ftLastAccessTime);
+ buf->st_ctime = FileTimeToUnixTime(&data.ftCreationTime);
+ buf->st_mtime = FileTimeToUnixTime(&data.ftLastWriteTime);
return 0;
}
/* }}} */