]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
copy the whole RRA not just the first row ...
authorTobias Oetiker <tobi@oetiker.ch>
Thu, 26 Feb 2015 07:12:08 +0000 (08:12 +0100)
committerTobias Oetiker <tobi@oetiker.ch>
Thu, 26 Feb 2015 07:12:08 +0000 (08:12 +0100)
src/rrd_hw.c

index 3e56c81bb845b42e609a9cf04406e565d0be4f0c..f63058aa9981f002662c2851e021767b486823b5 100644 (file)
@@ -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) {