From patchwork Wed Nov 19 09:06:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 1345 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 0932C7E18; Wed, 19 Nov 2014 11:03:21 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 9BDEA682E for ; Wed, 19 Nov 2014 11:03:17 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 19 Nov 2014 01:06:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,415,1413270000"; d="scan'208";a="634383365" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 19 Nov 2014 01:06:14 -0800 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id sAJ96EUL008582; Wed, 19 Nov 2014 09:06:14 GMT Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id sAJ96EPX028472; Wed, 19 Nov 2014 09:06:14 GMT Received: (from bricha3@localhost) by sivswdev01.ir.intel.com with id sAJ96DBj028468; Wed, 19 Nov 2014 09:06:13 GMT From: Bruce Richardson To: dev@dpdk.org Date: Wed, 19 Nov 2014 09:06:13 +0000 Message-Id: <1416387973-28431-1-git-send-email-bruce.richardson@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] test: fix misplaced braces in strncmp call X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch fixes two occurances 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 --- app/test/test_devargs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/test/test_devargs.c b/app/test/test_devargs.c index f0acf8e..dcbdd09 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();