提交 3d46d4a1 编写于 作者: A Andrea Bolognani

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: NAndrea Bolognani <abologna@redhat.com>
ACKed-by: NPeter Krempa <pkrempa@redhat.com>
上级 17eb6fc1
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册