From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier Matz Subject: [PATCH 1/5] test-devargs: fix misplaced braces in strncmp call Date: Wed, 17 Dec 2014 13:55:21 +0100 Message-ID: <1418820925-20318-2-git-send-email-olivier.matz@6wind.com> References: <1418820925-20318-1-git-send-email-olivier.matz@6wind.com> To: dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1418820925-20318-1-git-send-email-olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" One occurrence 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. Seen with clang-3.5: "error: size argument in 'strncmp' call is a comparison" This patch is similar to 261386248 but it looks that one occurence was forgotten. Signed-off-by: Olivier Matz --- app/test/test_devargs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test/test_devargs.c b/app/test/test_devargs.c index dcbdd09..3d9f7bc 100644 --- a/app/test/test_devargs.c +++ b/app/test/test_devargs.c @@ -105,7 +105,7 @@ test_devargs(void) devargs->pci.addr.devid != 0 || devargs->pci.addr.function != 1) goto fail; - if (strncmp(devargs->args, "", sizeof(devargs->args) != 0)) + if (strncmp(devargs->args, "", sizeof(devargs->args)) != 0) goto fail; free_devargs_list(); -- 2.1.3