diff options
author | Max Kellermann <max@musicpd.org> | 2019-08-19 22:09:38 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2019-12-16 23:03:25 +0100 |
commit | b02890eb8a1b014e575efe4130793d31a5ac0bb1 (patch) | |
tree | e82eaadd471c63c8421f12eae95277e084661e45 /src/time | |
parent | da882a6eb62b4070ce163f805c0cd61b0a2f1561 (diff) |
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.
Diffstat (limited to 'src/time')
-rw-r--r-- | src/time/Parser.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/time/Parser.cxx b/src/time/Parser.cxx index b09bba14f..369408efb 100644 --- a/src/time/Parser.cxx +++ b/src/time/Parser.cxx @@ -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"); |