From ee2520cb3d18aad93525919e03451ec85e3cc64b Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 18 Apr 2018 13:17:31 +0300 Subject: [PATCH] shared/util: Fix return of strsuffix strsuffix shall return an int just like str* functions. --- src/shared/util.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/shared/util.c b/src/shared/util.c index 986e2b22d..43a81afa0 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -1010,18 +1010,18 @@ int strsuffix(const char *str, const char *suffix) int suffix_len; if (!str || !suffix) - return false; + return -1; if (str[0] == '\0' && suffix[0] != '\0') - return false; + return -1; if (suffix[0] == '\0' && str[0] != '\0') - return false; + return -1; len = strlen(str); suffix_len = strlen(suffix); if (len < suffix_len) - return false; + return -1; return strncmp(str + len - suffix_len, suffix, suffix_len); } -- 2.47.3