From: Bruce Richardson Date: Wed, 19 Nov 2014 09:06:13 +0000 (+0000) Subject: app/test: fix misplaced braces in devargs check X-Git-Tag: spdx-start~10133 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=26138624815761416c0186674fc44bed9f615617;p=dpdk.git app/test: fix misplaced braces in devargs check This patch fixes two occurrences where a call to strncmp had the closing brace in the wrong place. Changing this form: if (strncmp(X,Y,sizeof(X) != 0)) which does a comparison of length 1, to if (strncmp(X,Y,sizeof(X)) != 0) which does the correct length comparison and then compares the result to zero in the "if" part, as the author presumably originally intended. Reported-by: Larry Wang Signed-off-by: Bruce Richardson Acked-by: Olivier Matz --- diff --git a/app/test/test_devargs.c b/app/test/test_devargs.c index f0acf8e3f6..dcbdd09f92 100644 --- a/app/test/test_devargs.c +++ b/app/test/test_devargs.c @@ -90,9 +90,9 @@ test_devargs(void) goto fail; devargs = TAILQ_FIRST(&devargs_list); if (strncmp(devargs->virtual.drv_name, "eth_ring1", - sizeof(devargs->virtual.drv_name) != 0)) + sizeof(devargs->virtual.drv_name)) != 0) goto fail; - if (strncmp(devargs->args, "k1=val,k2=val2", sizeof(devargs->args) != 0)) + if (strncmp(devargs->args, "k1=val,k2=val2", sizeof(devargs->args)) != 0) goto fail; free_devargs_list();