aboutsummaryrefslogtreecommitdiffhomepage
path: root/history.cpp
diff options
context:
space:
mode:
authorGravatar Konrad Borowski <glitchmr@myopera.com>2013-11-19 18:36:20 +0100
committerGravatar Konrad Borowski <glitchmr@myopera.com>2013-11-19 18:36:20 +0100
commit90b78326d393d2490e43491a93d8db4b449b972e (patch)
tree06a91035b757e2a3968b30a386d50523a0667086 /history.cpp
parent8fc26c1e580d3916b179979172ffe7bb408dc7ab (diff)
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.
Diffstat (limited to 'history.cpp')
-rw-r--r--history.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/history.cpp b/history.cpp
index 57689ad4..2c4fcb08 100644
--- a/history.cpp
+++ b/history.cpp
@@ -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())