]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - pdns/dolog.hh
auth, rec, dnsdist: check strftime return value for logging timestamps
[thirdparty/pdns.git] / pdns / dolog.hh
index fd6097dd105dbb8793845b0464ba48a4a91512a4..3c5237a5bd20396ad5354aeb4f683b4f6fd49c3e 100644 (file)
@@ -103,7 +103,9 @@ void genlog(int level, const char* s, Args... args)
     time_t t;
     time(&t);
     localtime_r(&t, &tm);
-    strftime(buffer, sizeof(buffer), "%b %d %H:%M:%S ", &tm);
+    if (strftime(buffer, sizeof(buffer), "%b %d %H:%M:%S ", &tm) == 0) {
+      buffer[0] = '\0';
+    }
     std::cout<<buffer;
   }
 #endif