From e7d1bdfbd20987a6f2bdeec4b1bc4e38ce24b64d Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Sat, 11 Aug 2012 15:00:46 -0400 Subject: [PATCH] virsh.c: Fix compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For some reason I only get this after applying subsequent upcoming patches that touch virsh, but don't seem to actually cause the warning. virsh.c: In function ‘vshCommandParse’: virsh.c:2014:46: error: ‘opt_index’ may be used uninitialized in this function [-Werror=maybe-uninitialized] cc1: all warnings being treated as errors --- tools/virsh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virsh.c b/tools/virsh.c index b95a008af6..64e2e18a15 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -1975,7 +1975,7 @@ vshCommandParse(vshControl *ctl, vshCommandParser *parser) } else if (tkdata[0] == '-' && tkdata[1] == '-' && c_isalnum(tkdata[2])) { char *optstr = strchr(tkdata + 2, '='); - int opt_index; + int opt_index = 0; if (optstr) { *optstr = '\0'; /* convert the '=' to '\0' */