]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Use localtime_r
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 19 Sep 2019 16:57:07 +0000 (11:57 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 19 Sep 2019 16:57:07 +0000 (11:57 -0500)
src/bin/radsniff.c

index 5ec762236101dd156ade786ee92732aff55bf526..56b8d29dc407b14fb3ffdfdfa1236c983490aabf 100644 (file)
@@ -192,13 +192,14 @@ static void rs_time_print(char *out, size_t len, struct timeval const *t)
        size_t ret;
        struct timeval now;
        uint32_t usec;
+       struct tm result;
 
        if (!t) {
                now = fr_time_to_timeval(fr_time());
                t = &now;
        }
 
-       ret = strftime(out, len, "%Y-%m-%d %H:%M:%S", localtime(&t->tv_sec));
+       ret = strftime(out, len, "%Y-%m-%d %H:%M:%S", localtime_r(&t->tv_sec, &result));
        if (ret >= len) {
                return;
        }