mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
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 <abologna@redhat.com> ACKed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
17eb6fc1b8
commit
3d46d4a1bc
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user