diff options
author | Steve Peters <steve@fisharerojo.org> | 2005-04-22 17:36:03 -0500 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2005-04-23 13:56:18 +0000 |
commit | ca46b8ee06bde4bff70dee92de161b97200c8d19 (patch) | |
tree | 56e353bcdbca872b0ad25682d623de510f8badd6 | |
parent | e198f03960fbf8b32df990ba7dc401b8dd6f294a (diff) | |
download | perl-ca46b8ee06bde4bff70dee92de161b97200c8d19.tar.gz |
Fix for warnings in util.c/Perl_init_tm()
Message-Id: <20050423033603.GA32547@mccoy.peters.homeunix.org>
localtime() can return null
p4raw-id: //depot/perl@24307
-rw-r--r-- | util.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -3355,7 +3355,9 @@ Perl_init_tm(pTHX_ struct tm *ptm) /* see mktime, strftime and asctime */ #ifdef HAS_TM_TM_ZONE Time_t now; (void)time(&now); - Copy(localtime(&now), ptm, 1, struct tm); + struct tm* my_tm = localtime(&now); + if (my_tm) + Copy(my_tm, ptm, 1, struct tm); #endif } |