summaryrefslogtreecommitdiffstats
path: root/Modules/timemodule.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2018-09-14 17:39:13 (GMT)
committerGitHub <noreply@github.com>2018-09-14 17:39:13 (GMT)
commitb93062b7fbc965cd0d522f597ed51eb4e493dfc2 (patch)
tree22c51e88110811b07027d99a7311516e06a5f09d /Modules/timemodule.c
parent271818fe279df5ab292789f97c3a52c477bd8f13 (diff)
downloadcpython-b93062b7fbc965cd0d522f597ed51eb4e493dfc2.zip
cpython-b93062b7fbc965cd0d522f597ed51eb4e493dfc2.tar.gz
cpython-b93062b7fbc965cd0d522f597ed51eb4e493dfc2.tar.bz2
bpo-34672: Don't pass NULL to gmtime_r. (GH-9312)
Diffstat (limited to 'Modules/timemodule.c')
-rw-r--r--Modules/timemodule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 8118b31..1a4cff2 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -1764,7 +1764,8 @@ PyInit_time(void)
#if defined(__linux__) && !defined(__GLIBC__)
struct tm tm;
- if (gmtime_r(0, &tm) != NULL)
+ const time_t zero = 0;
+ if (gmtime_r(&zero, &tm) != NULL)
utc_string = tm.tm_zone;
#endif