summaryrefslogtreecommitdiff
path: root/strbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'strbuf.c')
-rw-r--r--strbuf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/strbuf.c b/strbuf.c
index 1170d01c43..0d784b59d5 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -10,13 +10,13 @@ int prefixcmp(const char *str, const char *prefix)
return (unsigned char)*prefix - (unsigned char)*str;
}
-int suffixcmp(const char *str, const char *suffix)
+int has_suffix(const char *str, const char *suffix)
{
int len = strlen(str), suflen = strlen(suffix);
if (len < suflen)
- return -1;
+ return 0;
else
- return strcmp(str + len - suflen, suffix);
+ return !strcmp(str + len - suflen, suffix);
}
/*