X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_format.c;h=fba9eb0e85a62105cdb9f88a2097bab4b692648a;hb=2f811c28462aa8079c8a0ed4f9962265f217b113;hp=501b2676d95b6661966b85eadc9ba2b849285f99;hpb=00d2f049a74cfd7e6d371e2c2c187f40013fbb45;p=rrdtool.git diff --git a/src/rrd_format.c b/src/rrd_format.c index 501b267..fba9eb0 100644 --- a/src/rrd_format.c +++ b/src/rrd_format.c @@ -48,6 +48,9 @@ * *****************************************************************************/ #include "rrd_tool.h" +#ifdef WIN32 +#include "stdlib.h" +#endif #define converter(VV,VVV) \ if (strcmp(#VV, string) == 0) return VVV; @@ -125,8 +128,7 @@ off_t rrd_get_header_size( return sizeof(stat_head_t) + \ sizeof(ds_def_t) * rrd->stat_head->ds_cnt + \ sizeof(rra_def_t) * rrd->stat_head->rra_cnt + \ - sizeof(time_t) + \ - sizeof(live_head_t) + \ + ( atoi(rrd->stat_head->version) < 3 ? sizeof(time_t) : sizeof(live_head_t) ) + \ sizeof(pdp_prep_t) * rrd->stat_head->ds_cnt + \ sizeof(cdp_prep_t) * rrd->stat_head->ds_cnt * rrd->stat_head->rra_cnt + \ sizeof(rra_ptr_t) * rrd->stat_head->rra_cnt;