DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Michael Santana <msantana@redhat.com>
Cc: dev@dpdk.org, Rasesh Mody <rmody@marvell.com>,
	Shahed Shaikh <shshaikh@marvell.com>,
	Matan Azrad <matan@mellanox.com>,
	Anatoly Burakov <anatoly.burakov@intel.com>,
	Byron Marohn <byron.marohn@intel.com>,
	Pablo de Lara Guarch <pablo.de.lara.guarch@intel.com>,
	Aaron Conole <aconole@redhat.com>
Subject: Re: [dpdk-dev] [PATCH] Fix off-by-one errors in snprintf in various files
Date: Fri, 10 May 2019 15:55:42 +0100	[thread overview]
Message-ID: <20190510145541.GB87@bricha3-MOBL.ger.corp.intel.com> (raw)
In-Reply-To: <20190510145312.409-1-msantana@redhat.com>

On Fri, May 10, 2019 at 10:53:12AM -0400, 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 <msantana@redhat.com>
> ---
>  drivers/net/qede/base/bcm_osal.c                        | 4 ++--
>  drivers/net/qede/qede_filter.c                          | 2 +-
>  drivers/net/vdev_netvsc/vdev_netvsc.c                   | 2 +-
>  examples/multi_process/client_server_mp/shared/common.h | 2 +-
>  examples/server_node_efd/shared/common.h                | 2 +-
>  lib/librte_eal/common/eal_common_options.c              | 3 +--
>  lib/librte_eal/common/eal_filesystem.h                  | 9 ++++-----
>  lib/librte_eal/common/malloc_heap.c                     | 4 ++--
>  8 files changed, 13 insertions(+), 15 deletions(-)
> 
Looks a good cleanup, thanks.

Acked-by: Bruce Richardson <bruce.richardson@intel.com>

  parent reply	other threads:[~2019-05-10 14:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-10 14:53 Michael Santana
2019-05-10 14:53 ` Michael Santana
2019-05-10 14:55 ` Bruce Richardson [this message]
2019-05-10 14:55   ` Bruce Richardson
2019-05-29 10:51   ` Thomas Monjalon
2019-05-10 15:28 ` Burakov, Anatoly
2019-05-10 15:28   ` Burakov, Anatoly
2019-05-28 13:33   ` Michael Santana Francisco

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190510145541.GB87@bricha3-MOBL.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=aconole@redhat.com \
    --cc=anatoly.burakov@intel.com \
    --cc=byron.marohn@intel.com \
    --cc=dev@dpdk.org \
    --cc=matan@mellanox.com \
    --cc=msantana@redhat.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=rmody@marvell.com \
    --cc=shshaikh@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).