From 17eb6fc1b85b5a84b4e637177f3454704b937b8f Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Thu, 7 Mar 2019 10:18:58 +0100 Subject: [PATCH] util: Make virStringMatchesNameSuffix() return bool It's a predicate, so bool is the appropriate return type. Signed-off-by: Andrea Bolognani ACKed-by: Peter Krempa --- src/util/virstring.c | 6 +++--- src/util/virstring.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/util/virstring.c b/src/util/virstring.c index e479d3194c..f669d59f58 100644 --- a/src/util/virstring.c +++ b/src/util/virstring.c @@ -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; } /** diff --git a/src/util/virstring.h b/src/util/virstring.h index f5f1ecbe1e..1e36ac459c 100644 --- a/src/util/virstring.h +++ b/src/util/virstring.h @@ -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,