projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make sure vdef calcs only calc as far as originally requested.
[rrdtool.git]
/
src
/
rrd_graph.c
diff --git
a/src/rrd_graph.c
b/src/rrd_graph.c
index
480041f
..
760e3a3
100644
(file)
--- a/
src/rrd_graph.c
+++ b/
src/rrd_graph.c
@@
-4510,15
+4510,18
@@
int vdef_calc(
graph_desc_t *src, *dst;
rrd_value_t *data;
long step, steps;
graph_desc_t *src, *dst;
rrd_value_t *data;
long step, steps;
+ unsigned long end;
dst = &im->gdes[gdi];
src = &im->gdes[dst->vidx];
data = src->data + src->ds;
dst = &im->gdes[gdi];
src = &im->gdes[dst->vidx];
data = src->data + src->ds;
- steps = (src->end - src->start) / src->step;
+ end = src->end_orig % src->step == 0 ? src->end_orig : (src->end_orig + src->step - src->end_orig % src->step);
+
+ steps = (end - src->start) / src->step;
#if 0
printf
("DEBUG: start == %lu, end == %lu, %lu steps\n",
#if 0
printf
("DEBUG: start == %lu, end == %lu, %lu steps\n",
- src->start, src->end, steps);
+ src->start, src->end
_orig
, steps);
#endif
switch (dst->vf.op) {
case VDEF_PERCENT:{
#endif
switch (dst->vf.op) {
case VDEF_PERCENT:{