]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Initialize local variable junk
authorWolfgang Stöggl <c72578@yahoo.de>
Thu, 24 Jan 2019 16:44:01 +0000 (17:44 +0100)
committerTobias Oetiker <tobi@oetiker.ch>
Fri, 25 Jan 2019 09:59:46 +0000 (10:59 +0100)
- Fixes the following compiler warnings (MSVC):
  rrd_modify.c(439) : warning C4700: uninitialized local variable
  'junk' used
  rrd_modify.c(1027) : warning C4700: uninitialized local variable
  'junk' used

src/rrd_modify.c

index f40dd5fa84e82db6963ba798a8bb0ad5ba8cc7c8..0a94b502b1859fb682511d651fb753fbc43858f7 100644 (file)
@@ -435,7 +435,8 @@ static int populate_row(const rrd_t *in_rrd,
 
     int i, ri;
     candidate_extra_t junk;
-    
+    junk.l = 0; /* Initialize junk.l to avoid warning C4700 in MSVC */
+
     candidates = find_candidate_rras(in_rrd, new_rra, &candidates_cnt, junk, select_for_modify);
     if (candidates == NULL) {
        goto done;
@@ -1023,7 +1024,8 @@ static void prepare_CDPs(const rrd_t *in, rrd_t *out,
     candidate_t *candidates = NULL;
     candidate_t *chosen_candidate = NULL;
     candidate_extra_t junk;
-    
+    junk.l = 0;
+
     candidates = find_candidate_rras(in, rra_def, &candidates_cnt, junk, select_for_modify);
 
     if (candidates != NULL) {