From: Tobias Oetiker Date: Thu, 26 Feb 2015 07:12:08 +0000 (+0100) Subject: copy the whole RRA not just the first row ... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa589f40e4e716de048f066eca4df0b3fb7ff1d3;p=thirdparty%2Frrdtool-1.x.git copy the whole RRA not just the first row ... --- diff --git a/src/rrd_hw.c b/src/rrd_hw.c index 3e56c81b..f63058aa 100644 --- a/src/rrd_hw.c +++ b/src/rrd_hw.c @@ -213,8 +213,8 @@ int apply_smoother( /* as we are working through the value, we have to make sure to not double apply the smoothing after wrapping around. so best is to copy the rrd_values first */ - rrd_values_cpy = (rrd_value_t *) calloc(row_length, sizeof(rrd_value_t)); - memcpy(rrd_values_cpy,rrd_values,sizeof(rrd_value_t)*row_length); + rrd_values_cpy = (rrd_value_t *) calloc(row_length*row_count, sizeof(rrd_value_t)); + memcpy(rrd_values_cpy,rrd_values,sizeof(rrd_value_t)*row_length*row_count); /* compute moving averages */ for (i = offset; i < row_count + offset; ++i) {