summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Peters <steve@fisharerojo.org>2005-04-22 17:36:03 -0500
committerDave Mitchell <davem@fdisolutions.com>2005-04-23 13:56:18 +0000
commitca46b8ee06bde4bff70dee92de161b97200c8d19 (patch)
tree56e353bcdbca872b0ad25682d623de510f8badd6
parente198f03960fbf8b32df990ba7dc401b8dd6f294a (diff)
downloadperl-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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/util.c b/util.c
index 5c1cdea1f3..db5620494a 100644
--- a/util.c
+++ b/util.c
@@ -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
}