From: Alan T. DeKok Date: Mon, 7 Oct 2019 14:42:18 +0000 (-0400) Subject: fix arguments to localtime_r X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fa7187e7559a0c5fab04c64cc4e1fc75397c411;p=thirdparty%2Ffreeradius-server.git fix arguments to localtime_r --- diff --git a/src/lib/util/time.c b/src/lib/util/time.c index 3a10eded07b..9084a04aa91 100644 --- a/src/lib/util/time.c +++ b/src/lib/util/time.c @@ -74,6 +74,7 @@ static uint64_t our_mach_epoch; static inline int fr_time_sync(void) { struct tm tm; + time_t now; /* * our_realtime represents system time @@ -122,7 +123,8 @@ static inline int fr_time_sync(void) * Get local time zone name, daylight savings, and GMT * offsets. */ - (void) localtime_r(time(NULL), &tm); + now = time(NULL); + (void) localtime_r(&now, &tm); isdst = (tm.tm_isdst != 0); tz_names[isdst] = tm.tm_zone;