From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 9EDB9A046B for ; Tue, 28 May 2019 15:33:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 51EC94C8B; Tue, 28 May 2019 15:33:31 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 0ED5D2E8F for ; Tue, 28 May 2019 15:33:30 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 17269300C035; Tue, 28 May 2019 13:33:19 +0000 (UTC) Received: from localhost.localdomain (unknown [10.18.25.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2DADB7DF59; Tue, 28 May 2019 13:33:17 +0000 (UTC) To: dev@dpdk.org Cc: "Burakov, Anatoly" , Rasesh Mody , Shahed Shaikh , Matan Azrad , Byron Marohn , Pablo de Lara Guarch , Aaron Conole , Thomas Monjalon References: <20190510145312.409-1-msantana@redhat.com> <48b2d5ee-f6a6-9954-a45b-d2a581c5ace3@intel.com> From: Michael Santana Francisco Organization: Red Hat Message-ID: <7dcc3004-3f93-be4d-9643-b37616626cb5@redhat.com> Date: Tue, 28 May 2019 09:33:17 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <48b2d5ee-f6a6-9954-a45b-d2a581c5ace3@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 28 May 2019 13:33:29 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH] Fix off-by-one errors in snprintf in various files X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: msantana@redhat.com List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 5/10/19 11:28 AM, Burakov, Anatoly wrote: > On 10-May-19 3:53 PM, Michael Santana wrote: >> snprintf guarantees to always correctly place a null terminator in >> the buffer >> string. So manually placing a null terminator in a buffer right after >> a call >> to snprintf is redundant code. >> >> Additionally, there is no need to use 'sizeof(buffer) - 1' in >> snprintf as this >> means we are not using the last character in the buffer. >> 'sizeof(buffer)' is >> enough. >> >> Cc: stable@dpdk.org >> >> Signed-off-by: Michael Santana >> --- > > LGTM > > Acked-by: Anatoly Burakov > ping