index 877120ed43c50897dd7afab06703523ff0f23554..39941c1cd4ada12fbf79bca413e44a904edb588a 100644 (file)
--- a/program/src/rrd_resize.c
+++ b/program/src/rrd_resize.c
modify=strtol(argv[4],&endptr,0);
if ((modify<1)) {
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);
}
return(-1);
}
fclose(infile);
return(-1);
}
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;
rrdnew.stat_head = rrdold.stat_head;
rrdnew.ds_def = rrdold.ds_def;