From: Wolfgang Stöggl Date: Sat, 14 Jul 2018 12:31:06 +0000 (+0200) Subject: Fix lastupdate time in dump (32bit MSVC only) X-Git-Tag: v1.7.1~56^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F894%2Fhead;p=thirdparty%2Frrdtool-1.x.git 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 --- 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");