diff options
| author | Ghasem Naddaf <ghasem.naddaf@gmail.com> | 2020-03-11 09:50:54 -0700 |
|---|---|---|
| committer | Ghasem Naddaf <ghasem.naddaf@gmail.com> | 2020-03-11 09:50:54 -0700 |
| commit | 31384f929ad817f5a6459feeb6f27ff292b35e2f (patch) | |
| tree | 9072ac9757649e446f8018f44379c8068e1bfa23 /lib/log.c | |
| parent | 912c556b3a0354f37328f52108777e434307e339 (diff) | |
| parent | 4a652d922754bfb9e4216347cfc6ea59d068b800 (diff) | |
Merge branch 'master' into nhrp_bugfix
Diffstat (limited to 'lib/log.c')
| -rw-r--r-- | lib/log.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -220,11 +220,11 @@ size_t quagga_timestamp(int timestamp_precision, char *buf, size_t buflen) /* first, we update the cache if the time has changed */ if (cache.last != clock.tv_sec) { - struct tm *tm; + struct tm tm; cache.last = clock.tv_sec; - tm = localtime(&cache.last); + localtime_r(&cache.last, &tm); cache.len = strftime(cache.buf, sizeof(cache.buf), - "%Y/%m/%d %H:%M:%S", tm); + "%Y/%m/%d %H:%M:%S", &tm); } /* note: it's not worth caching the subsecond part, because chances are that back-to-back calls are not sufficiently close |
