diff options
Diffstat (limited to 'sbin/unwind/libunbound/util/log.c')
-rw-r--r-- | sbin/unwind/libunbound/util/log.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/unwind/libunbound/util/log.c b/sbin/unwind/libunbound/util/log.c index a15ee920c0f..86a3acee43c 100644 --- a/sbin/unwind/libunbound/util/log.c +++ b/sbin/unwind/libunbound/util/log.c @@ -271,8 +271,8 @@ log_vmsg(int pri, const char* type, } now = (time_t)time(NULL); #if defined(HAVE_STRFTIME) && defined(HAVE_LOCALTIME_R) - if(log_time_asc && strftime(tmbuf, sizeof(tmbuf), "%b %d %H:%M:%S", - localtime_r(&now, &tm))%(sizeof(tmbuf)) != 0) { + if(log_time_asc && localtime_r(&now, &tm) && strftime(tmbuf, + sizeof(tmbuf), "%b %d %H:%M:%S", &tm)%(sizeof(tmbuf)) != 0) { /* %sizeof buf!=0 because old strftime returned max on error */ fprintf(logfile, "%s %s[%d:%x] %s: %s\n", tmbuf, ident, (int)getpid(), tid?*tid:0, type, message); |