X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_resize.c;h=cdf88c31df962f43cb27f76eaedf83ed382427be;hb=0cdbc46c70b605d795a1ac3342d1ddddef0d307e;hp=3dbe058a483306db55f2d36a220c9cc324e3054c;hpb=5837606887a6d81e8b1f7588525cb1c8783fb62b;p=rrdtool.git diff --git a/src/rrd_resize.c b/src/rrd_resize.c index 3dbe058..cdf88c3 100644 --- a/src/rrd_resize.c +++ b/src/rrd_resize.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.0.33 Copyright Tobias Oetiker, 1997 - 2000 + * RRDtool 1.1.x Copyright Tobias Oetiker, 1997 - 2002 ***************************************************************************** * rrd_resize.c Alters size of an RRA ***************************************************************************** @@ -43,7 +43,7 @@ rrd_resize(int argc, char **argv) modify=strtol(argv[4],&endptr,0); if ((modify<1)) { - rrd_set_error("you must have at least one row in the RRA"); + rrd_set_error("Please grow or shrink with at least 1 row"); return(-1); } @@ -67,12 +67,14 @@ rrd_resize(int argc, char **argv) fclose(infile); return(-1); } - if ((rrdold.rra_def[target_rra].row_cnt+modify)<0) { - rrd_set_error("This RRA is not that big"); - rrd_free(&rrdold); - fclose(infile); - return(-1); - } + + if (modify < 0) + if (rrdold.rra_def[target_rra].row_cnt <= modify) { + rrd_set_error("This RRA is not that big"); + rrd_free(&rrdold); + fclose(infile); + return(-1); + } rrdnew.stat_head = rrdold.stat_head; rrdnew.ds_def = rrdold.ds_def;