qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/2] s390x: Use strpadcpy for copying vm name


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v2 2/2] s390x: Use strpadcpy for copying vm name
Date: Mon, 11 Jan 2021 19:02:31 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0

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 via email to

[Prev in Thread] Current Thread [Next in Thread]