This commit is contained in:
Philippe Teuwen 2019-04-28 22:54:00 +02:00
parent f1deb865db
commit 69f8d81f4e
12 changed files with 42 additions and 43 deletions

View file

@ -832,8 +832,7 @@ bool str_startswith(const char *s, const char *pre) {
bool str_endswith(const char *s, const char *suffix) { bool str_endswith(const char *s, const char *suffix) {
size_t ls = strlen(s); size_t ls = strlen(s);
size_t lsuffix = strlen(suffix); size_t lsuffix = strlen(suffix);
if (ls >= lsuffix) if (ls >= lsuffix) {
{
return strncmp(suffix, s + (ls - lsuffix), lsuffix) == 0; return strncmp(suffix, s + (ls - lsuffix), lsuffix) == 0;
} }
return false; return false;