From 7749d6c1a780e42613ebd9f97348565b84319216 Mon Sep 17 00:00:00 2001 From: oetiker Date: Sat, 26 Apr 2003 05:11:27 +0000 Subject: [PATCH] only restore V2 and larger. git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@202 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_restore.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/program/src/rrd_restore.c b/program/src/rrd_restore.c index 4371d659..f3764dac 100644 --- a/program/src/rrd_restore.c +++ b/program/src/rrd_restore.c @@ -129,6 +129,12 @@ int xml2rrd(char* buf, rrd_t* rrd, char rc){ free(rrd -> stat_head); return -1; } + if (atoi(rrd -> stat_head -> version) < 2) + { + rrd_set_error("Can only restore version >= 2 (Not %s). Dump your rrd using a current rrdtool dump.", rrd -> stat_head -> version ); + free(rrd -> stat_head); + return -1; + } rrd->stat_head->float_cookie = FLOAT_COOKIE; rrd->stat_head->ds_cnt = 0; rrd->stat_head->rra_cnt = 0; -- 2.30.2