projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update displayed copyright messages to be consistent. -- Mike Slifcak
[rrdtool.git]
/
src
/
rrd_resize.c
diff --git
a/src/rrd_resize.c
b/src/rrd_resize.c
index
877120e
..
39941c1
100644
(file)
--- a/
src/rrd_resize.c
+++ b/
src/rrd_resize.c
@@
-43,7
+43,7
@@
rrd_resize(int argc, char **argv)
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);
}
@@
-67,12
+67,14
@@
rrd_resize(int argc, char **argv)
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;