util: Make virStringMatchesNameSuffix() 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:
Andrea Bolognani 2019-03-07 10:18:58 +01:00
parent 956817ef49
commit 17eb6fc1b8
2 changed files with 6 additions and 6 deletions

View File

@ -1279,7 +1279,7 @@ virStringStripSuffix(char *str,
return true;
}
int
bool
virStringMatchesNameSuffix(const char *file,
const char *name,
const char *suffix)
@ -1291,9 +1291,9 @@ virStringMatchesNameSuffix(const char *file,
if (filelen == (namelen + suffixlen) &&
STREQLEN(file, name, namelen) &&
STREQLEN(file + namelen, suffix, suffixlen))
return 1;
return true;
else
return 0;
return false;
}
/**

View File

@ -294,9 +294,9 @@ bool virStringHasCaseSuffix(const char *str,
const char *suffix);
bool virStringStripSuffix(char *str,
const char *suffix) ATTRIBUTE_RETURN_CHECK;
int virStringMatchesNameSuffix(const char *file,
const char *name,
const char *suffix);
bool virStringMatchesNameSuffix(const char *file,
const char *name,
const char *suffix);
void virStringStripIPv6Brackets(char *str);
bool virStringHasChars(const char *str,