Re: [PATCH 7/7] util: Tweak virStringMatchesNameSuffix() some more

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

 



On Thu, Mar 07, 2019 at 11:14:46 +0100, Andrea Bolognani wrote:
> We can use STRNEQ() instead of STRNEQLEN() since we're only
> interested in the trailing part of the string.
> 
> Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
> ---
>  src/util/virstring.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/util/virstring.c b/src/util/virstring.c
> index ba36562f85..f23daca0bd 100644
> --- a/src/util/virstring.c
> +++ b/src/util/virstring.c
> @@ -1300,7 +1300,7 @@ virStringMatchesNameSuffix(const char *file,
>      if (STRNEQLEN(file, name, namelen))
>          return false;
>  
> -    if (STRNEQLEN(file + namelen, suffix, suffixlen))
> +    if (STRNEQ(file + namelen, suffix))
>          return false;

ACK to this if you rebase it without the previous patches. The change is
okay as we verify that filelen == (namelen + suffixlen) prior to
attempting this.

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux