qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Miroslav Rezanina <mrezanin@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH v2 2/2] s390x: Use strpadcpy for copying vm name
Date: Mon, 11 Jan 2021 19:02:31 +0100	[thread overview]
Message-ID: <1df4110d-f34f-7e3f-2363-b5882a5829bd@redhat.com> (raw)
In-Reply-To: <7334beb15bb36de2f9472264bea284f91abf686f.1610384501.git.mrezanin@redhat.com>

On 1/11/21 6:09 PM, Miroslav Rezanina wrote:
> When using strncpy with lenght equal to size of target array,

Typo "length".

> GCC 11 produce following warning:
> 
>    warning: '__builtin_strncpy' specified bound 256 equals destination size [-Wstringop-truncation]
> 
> To prevent this warning, use strpadcpy function that will enusure that
> provide functionality similar to strncpy but allow copy strings with
> length equal size of target array (and discarding endint zero) and
> ensure array is zeroed after copied string.

Hard to understand... Look like incorrect copy/paste in the middle?

> Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
> ---
>  target/s390x/kvm.c         | 12 +++++-------
>  target/s390x/misc_helper.c |  7 +++++--
>  2 files changed, 10 insertions(+), 9 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



  reply	other threads:[~2021-01-11 18:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-11 17:09 [PATCH v2 0/2] Fixing several GCC 11 warnings Miroslav Rezanina
2021-01-11 17:09 ` [PATCH v2 1/2] Fix net.c warning on GCC 11 Miroslav Rezanina
2021-01-11 17:09 ` [PATCH v2 2/2] s390x: Use strpadcpy for copying vm name Miroslav Rezanina
2021-01-11 18:02   ` Philippe Mathieu-Daudé [this message]
2021-01-12  9:09   ` Thomas Huth

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=1df4110d-f34f-7e3f-2363-b5882a5829bd@redhat.com \
    --to=philmd@redhat.com \
    --cc=mrezanin@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).