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.
This commit is contained in:
		| @@ -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"); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Max Kellermann
					Max Kellermann