diff --git a/src/rrd_format.c b/src/rrd_format.c
index 912373faf6e4a7f1bb2356ab55ec3b7a0ce2513e..ac85fc5de664ce1187a2e6b9452c9dd8f86e9fcb 100644 (file)
--- a/src/rrd_format.c
+++ b/src/rrd_format.c
/*****************************************************************************
- * RRDtool 1.3.2 Copyright by Tobi Oetiker, 1997-2008
+ * RRDtool 1.4.7 Copyright by Tobi Oetiker, 1997-2012
*****************************************************************************
* rrd_format.c RRD Database Format helper functions
*****************************************************************************
- * $Id: rrd_format.c 1795 2009-04-20 06:46:47Z oetiker $
+ * $Id: rrd_format.c 2267 2012-01-24 10:08:48Z oetiker $
* $Log$
* Revision 1.5 2004/05/18 18:53:03 oetiker
* big spell checking patch -- slif@bellsouth.net
*
*****************************************************************************/
#include "rrd_tool.h"
+#ifdef WIN32
+#include "stdlib.h"
+#endif
#define converter(VV,VVV) \
if (strcmp(#VV, string) == 0) return VVV;
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;