From: Andrea Bolognani Date: Thu, 7 Mar 2019 09:47:21 +0000 (+0100) Subject: util: Tweak virStringMatchesNameSuffix() X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=3d46d4a1bc8eac9b3110d2cfe442b3e241c81418;p=libvirt.git util: Tweak virStringMatchesNameSuffix() We can use STRNEQ() instead of STRNEQLEN() since we're only interested in the trailing part of the string and we've already verified that the length of file, name and suffix are those we expect. Signed-off-by: Andrea Bolognani ACKed-by: Peter Krempa --- diff --git a/src/util/virstring.c b/src/util/virstring.c index f669d59f58..33f8191f45 100644 --- a/src/util/virstring.c +++ b/src/util/virstring.c @@ -1290,7 +1290,7 @@ virStringMatchesNameSuffix(const char *file, if (filelen == (namelen + suffixlen) && STREQLEN(file, name, namelen) && - STREQLEN(file + namelen, suffix, suffixlen)) + STREQ(file + namelen, suffix)) return true; else return false;