From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by dpdk.org (Postfix) with ESMTP id 33F217E18 for ; Wed, 19 Nov 2014 11:10:11 +0100 (CET) Received: by mail-wi0-f174.google.com with SMTP id h11so4812825wiw.13 for ; Wed, 19 Nov 2014 02:20:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=vV7VHTdRkDI1Kdkb7PJvwM85IWFC8OdHSfZljdLJge8=; b=cVQyX/UkaGXuqDWmJI7Ae+piuYS8FB2jyYOAyZj2B5DQMj2wMAYYO28d26+ZlZ1pTQ v3MVndWJPa/AuzMEHqgbBRofkdxCrJDKPeO20dgSUXDUJhQAh+78SjRaG66oq55Z0SLc 0GT+dYn2USf0+9wPidHOnJX3+cVAmvYup166NMP2OITPowSrhxyDE3M+O7ut1xNl9kqH XxtryVQRV7pMSWdtJBnyIxKgCQJY7jWxUdy0VA/+h2JaOAVdAKdTzj3N0uFVO30MFFcA Of5/Vcwy8YGDLE3ogYELpps3/OvShzuBq0v9N/bzY9cI4r7rHgVYfAN9m3VMl+h6JCH/ thPw== X-Gm-Message-State: ALoCoQk+ajXy8jnuT6B2TD//t3WY37TWS0q/6efgvGW9jUd99rPlZnWfVPl9gaZen8kKmh/6D8jO X-Received: by 10.194.178.231 with SMTP id db7mr55044496wjc.112.1416392436229; Wed, 19 Nov 2014 02:20:36 -0800 (PST) Received: from [10.16.0.195] (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by mx.google.com with ESMTPSA id l10sm1555768wif.20.2014.11.19.02.20.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Nov 2014 02:20:35 -0800 (PST) Message-ID: <546C6EF3.1080507@6wind.com> Date: Wed, 19 Nov 2014 11:20:35 +0100 From: Olivier MATZ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.5.0 MIME-Version: 1.0 To: Bruce Richardson , dev@dpdk.org References: <1416387973-28431-1-git-send-email-bruce.richardson@intel.com> In-Reply-To: <1416387973-28431-1-git-send-email-bruce.richardson@intel.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [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: , X-List-Received-Date: Wed, 19 Nov 2014 10:10:11 -0000 Hi Bruce, On 11/19/2014 10:06 AM, Bruce Richardson wrote: > 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 > --- > 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(); > > Nice catch! Acked-by: Olivier Matz