mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
util: Make virStringHasCaseSuffix() return bool
It's a predicate, so bool is the appropriate return type. Signed-off-by: Andrea Bolognani <abologna@redhat.com> ACKed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
696239ba6f
commit
fcf78395d7
@ -1248,7 +1248,7 @@ virStringHasSuffix(const char *str,
|
||||
return STREQ(str + len - suffixlen, suffix);
|
||||
}
|
||||
|
||||
int
|
||||
bool
|
||||
virStringHasCaseSuffix(const char *str,
|
||||
const char *suffix)
|
||||
{
|
||||
@ -1256,7 +1256,7 @@ virStringHasCaseSuffix(const char *str,
|
||||
int suffixlen = strlen(suffix);
|
||||
|
||||
if (len < suffixlen)
|
||||
return 0;
|
||||
return false;
|
||||
|
||||
return STRCASEEQ(str + len - suffixlen, suffix);
|
||||
}
|
||||
|
@ -290,8 +290,8 @@ char *virStringReplace(const char *haystack,
|
||||
|
||||
bool virStringHasSuffix(const char *str,
|
||||
const char *suffix);
|
||||
int virStringHasCaseSuffix(const char *str,
|
||||
const char *suffix);
|
||||
bool virStringHasCaseSuffix(const char *str,
|
||||
const char *suffix);
|
||||
int virStringStripSuffix(char *str,
|
||||
const char *suffix) ATTRIBUTE_RETURN_CHECK;
|
||||
int virStringMatchesNameSuffix(const char *file,
|
||||
|
Loading…
Reference in New Issue
Block a user