Fix some "variable might be used uninitialized" warnings

In particular, gcc complains as follows: CC tree-walk.o tree-walk.c: In function `traverse_trees': tree-walk.c:347: warning: 'e' might be used uninitialized in this \ function CC builtin/revert.o builtin/revert.c: In function `verify_opt_mutually_compatible': builtin/revert.c:113: warning: 'opt2' might be used uninitialized in \ this function Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ramsay Jones committed Sep 11, 2011 at 20:39 UTC 27c0f768843b6d844674f1fb8dc2676d830b56e3
2 files changed +2 -2
builtin/revert.c
+1 -1
@@ -110,7 +110,7 @@ static void verify_opt_compatible(const char *me, const char *base_opt, ...)
110
111 static void verify_opt_mutually_compatible(const char *me, ...)
112 {
113 - const char *opt1, *opt2;
113 + const char *opt1, *opt2 = NULL;
114 va_list ap;
115
116 va_start(ap, me);
tree-walk.c
+1 -1
@@ -344,7 +344,7 @@ int traverse_trees(int n, struct tree_desc *t, struct traverse_info *info)
344 unsigned long mask, dirmask;
345 const char *first = NULL;
346 int first_len = 0;
347 - struct name_entry *e;
347 + struct name_entry *e = NULL;
348 int len;
349
350 for (i = 0; i < n; i++) {