Cast timestamp before using it for formatted string.

time_t doesn't necessarily have to be a long number. In fact, manpage
for types.h mentions it can be a double value.
This commit is contained in:
Konrad Borowski 2013-11-19 18:36:20 +01:00
parent 8fc26c1e58
commit 90b78326d3

View file

@ -286,7 +286,7 @@ static void append_yaml_to_buffer(const wcstring &wcmd, time_t timestamp, const
buffer->append("- cmd: ", cmd.c_str(), "\n");
char timestamp_str[96];
snprintf(timestamp_str, sizeof timestamp_str, "%ld", timestamp);
snprintf(timestamp_str, sizeof timestamp_str, "%ld", (long) timestamp);
buffer->append(" when: ", timestamp_str, "\n");
if (! required_paths.empty())