Commit 2e53e924 authored by Max Kellermann's avatar Max Kellermann

time/Parser: explicitly initialize struct tm before strptime()

This is recommended by the strptime() manpage, because strptime() does not initialize/set attributes which were not specified in the format string.
parent b7abd569
......@@ -65,7 +65,7 @@ ParseTimePoint(const char *s, const char *format)
(void)format;
throw std::runtime_error("Time parsing not implemented on Windows");
#else
struct tm tm;
struct tm tm{};
const char *end = strptime(s, format, &tm);
if (end == nullptr || *end != 0)
throw std::runtime_error("Failed to parse time stamp");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment