public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Omar Sandoval <osandov@osandov.com>
To: Damien Le Moal <damien.lemoal@wdc.com>
Cc: linux-block@vger.kernel.org, Omar Sandoval <osandov@fb.com>
Subject: Re: [PATCH blktests] blktests: Fix compilation warning
Date: Tue, 18 Dec 2018 13:57:29 -0800	[thread overview]
Message-ID: <20181218215729.GA12683@vader> (raw)
In-Reply-To: <20181217055108.11461-1-damien.lemoal@wdc.com>

On Mon, Dec 17, 2018 at 02:51:08PM +0900, Damien Le Moal wrote:
> Fix strncpy length to "sizeof(buf) - 1" to avoid the compiler warning:
> cc  -O2 -Wall -Wshadow  -o sg/syzkaller1 sg/syzkaller1.c
> sg/syzkaller1.c: In function ‘syz_open_dev.constprop’:
> sg/syzkaller1.c:204:16: warning: ‘strncpy’ specified bound 1024 equals
> destination size [-Wstringop-truncation]
>      NONFAILING(strncpy(buf, (char*)a0, sizeof(buf)));
>                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> sg/syzkaller1.c:143:7: note: in definition of macro ‘NONFAILING’
>        __VA_ARGS__;                                                     \
>        ^~~~~~~~~~~
> 
> Since the last character of buf is forced set to 0, there is no
> functional change introduced by this patch.
> 
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>

Applied, thanks, Damien.

      reply	other threads:[~2018-12-18 21:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-17  5:51 [PATCH blktests] blktests: Fix compilation warning Damien Le Moal
2018-12-18 21:57 ` Omar Sandoval [this message]

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=20181218215729.GA12683@vader \
    --to=osandov@osandov.com \
    --cc=damien.lemoal@wdc.com \
    --cc=linux-block@vger.kernel.org \
    --cc=osandov@fb.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