Skip to contentSkip to conversation

lib/rbtree_test.c: fix uninitialized variable warning

PATCH New Cong Ding 1 participant 1 message Dec 11, 2012 Library code

lore
Share & tools
lore

Cong Ding

author
#0 lore raw

PATCH 1/1 lib/rbtree_test.c: fix uninitialized variable warning

this patch is to fix the following compilation warning:
lib/rbtree_test.c: In function ‘check’:
lib/rbtree_test.c:121: warning: ‘blacks’ may be used uninitialized in this function

the use of variable blacks in line 133 might be uninitialized

---
 lib/rbtree_test.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/rbtree_test.c +1 -1
index da96578..af38aed 100644
@@ -118,7 +118,7 @@ static void check(int nr_nodes)
 {
 	struct rb_node *rb;
 	int count = 0;
-	int blacks;
+	int blacks = 0;
 	u32 prev_key = 0;
 
 	for (rb = rb_first(&root); rb; rb = rb_next(rb)) {
Signature · 1 line
1.7.4.5