diff options
author | Daniel Beulshausen <dbeu@php.net> | 2001-03-13 11:09:37 +0000 |
---|---|---|
committer | Daniel Beulshausen <dbeu@php.net> | 2001-03-13 11:09:37 +0000 |
commit | a37a9db454d8910201bd3bbf6d6bef1bdd8cfb66 (patch) | |
tree | c9c41a81ca072dd1400219fcce64b579115cc719 /main/reentrancy.c | |
parent | 285ec0ca2c27bc365e4e2bdf18072cb7d3b90445 (diff) | |
download | php-git-a37a9db454d8910201bd3bbf6d6bef1bdd8cfb66.tar.gz |
fix bug in php_gmtime_r
Diffstat (limited to 'main/reentrancy.c')
-rw-r--r-- | main/reentrancy.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/main/reentrancy.c b/main/reentrancy.c index 00bd0c97f2..027bb8c8a4 100644 --- a/main/reentrancy.c +++ b/main/reentrancy.c @@ -205,11 +205,14 @@ PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm) local_lock(GMTIME_R); tmp = gmtime(timep); - memcpy(p_tm, tmp, sizeof(struct tm)); + if (tmp) { + memcpy(p_tm, tmp, sizeof(struct tm)); + tmp = p_tm; + } local_unlock(GMTIME_R); - return p_tm; + return tmp; } #endif |