From: Maksym Sobolyev Date: Wed, 17 Sep 2014 00:54:03 +0000 (-0700) Subject: Don't update pdp_new[] in-place, this is a bad practice from the X-Git-Tag: v1.5.0-rc1~6^2~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6ce883f38d4c0fb0f0fb130b977a01fe15ba089;p=thirdparty%2Frrdtool-1.x.git Don't update pdp_new[] in-place, this is a bad practice from the error-handling prospective. --- diff --git a/src/rrd_update.c b/src/rrd_update.c index 1f9d16c8..bd1bf228 100644 --- a/src/rrd_update.c +++ b/src/rrd_update.c @@ -1421,7 +1421,7 @@ static int update_pdp_prep( } break; case DST_ABSOLUTE: - if( rrd_strtodbl(updvals[ds_idx + 1], NULL, &pdp_new[ds_idx], "Function update_pdp_prep, case DST_ABSOLUTE" ) != 2 ) { + if( rrd_strtodbl(updvals[ds_idx + 1], NULL, &newval, "Function update_pdp_prep, case DST_ABSOLUTE" ) != 2 ) { return -1; } pdp_new[ds_idx] = newval;