mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 05:28:49 +00:00
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:
parent
8fc26c1e58
commit
90b78326d3
1 changed files with 1 additions and 1 deletions
|
@ -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())
|
||||
|
|
Loading…
Reference in a new issue