kvargs: fix build with gcc 4.5.1
authorMin Cao <min.cao@intel.com>
Mon, 16 Jun 2014 03:22:11 +0000 (11:22 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 17 Jun 2014 17:01:59 +0000 (19:01 +0200)
GCC 4.5.1 warns about an uninitialized pointer:
error: 'ctx1' may be used uninitialized in this function

Signed-off-by: Min Cao <min.cao@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Waterman Cao <waterman.cao@intel.com>
lib/librte_kvargs/rte_kvargs.c

index a7586a3..8bc1e46 100644 (file)
@@ -48,7 +48,9 @@ static int
 rte_kvargs_tokenize(struct rte_kvargs *kvlist, const char *params)
 {
        unsigned i;
-       char *str, *ctx1, *ctx2;
+       char *str;
+       char *ctx1 = NULL;
+       char *ctx2 = NULL;
 
        /* Copy the const char *params to a modifiable string
         * to pass to rte_strsplit