From f7b712ad4357694805b7f88376015d20b7723bc5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wolfgang=20St=C3=B6ggl?= Date: Sat, 14 Jul 2018 14:31:06 +0200 Subject: [PATCH] Fix lastupdate time in dump (32bit MSVC only) - So far, (null) was written into the lastupdate time string: e.g.: 1511170870 - The problem occurred only in 32bit MSVC builds - Works for both, with or without _USE_32BIT_TIME_T --- src/rrd_dump.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/rrd_dump.c b/src/rrd_dump.c index 9412a8f1..514328ab 100644 --- a/src/rrd_dump.c +++ b/src/rrd_dump.c @@ -129,8 +129,15 @@ int rrd_dump_cb_r( #else # error "Need strftime" #endif +#if defined (_MSC_VER) && (_M_IX86) +/* Otherwise (null) will be written to %s when compiling for 32-bit using MSVC */ +/* works for both, with or without _USE_32BIT_TIME_T */ + CB_FMTS("\t%ld \n\n", + (long int) rrd.live_head->last_up, somestring); +#else CB_FMTS("\t%lld \n\n", (long long int) rrd.live_head->last_up, somestring); +#endif for (i = 0; i < rrd.stat_head->ds_cnt; i++) { CB_PUTS("\t\n"); -- 2.47.2