X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=src%2Frrd_restore.c;h=1164adbec0c9df876470030023a3b62c321f8146;hp=65bbb10438b0d9a7e0e72d0fbcaaa438e20fb46d;hb=a6cabd4d567fa0bfd8192ef99c804f1b2359e22d;hpb=aeeff12d6f81965685019e9d416f0ec71a1ce0ab diff --git a/src/rrd_restore.c b/src/rrd_restore.c index 65bbb10..1164adb 100644 --- a/src/rrd_restore.c +++ b/src/rrd_restore.c @@ -223,14 +223,12 @@ int xml2rrd( rrd->stat_head = NULL; return -1; } - /* make sure we output the right version */ - strcpy(rrd->stat_head->version, RRD_VERSION); - - /* if (atoi(rrd -> stat_head -> version) < 2) - { - rrd_set_error("Can only restore version >= 2 (Not %s). Dump your old rrd using a current rrdtool dump.", rrd -> stat_head -> version ); - return -1; - } */ + /* make sure we output the right version only go over 3 if input is over 3 too */ + if (input_version > 3 ){ + strcpy(rrd->stat_head->version, RRD_VERSION); + } else { + strcpy(rrd->stat_head->version, RRD_VERSION3); + } rrd->stat_head->float_cookie = FLOAT_COOKIE; rrd->stat_head->ds_cnt = 0;