]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
skip populating values for just added DS
authorPeter Stamfest <peter@stamfest.at>
Mon, 3 Mar 2014 00:01:46 +0000 (01:01 +0100)
committerPeter Stamfest <peter@stamfest.at>
Mon, 3 Mar 2014 07:26:20 +0000 (08:26 +0100)
src/rrd_modify.c

index 6647d60c05e1ffba915f5c19c523426dd24213ff..9d16476feb1f062cafe4b2004d84059ac4d6ff4f 100644 (file)
@@ -299,6 +299,9 @@ static int populate_row(const rrd_t *in_rrd,
 
                int in_k = ds_map ? ds_map[k] : k;
 
+               // if the DS was just added we have no pre-existing data anyway, so skip
+               if (in_k < 0) continue;
+
                for (cand_row = cand_row_start, ci = 0 ; 
                     ci < cand_rows ; 
                     ci++, cand_row = (cand_row + 1) % r->row_cnt)