diff --git a/src/chars.c b/src/chars.c index 2745ef33..8eed0e54 100644 --- a/src/chars.c +++ b/src/chars.c @@ -594,8 +594,7 @@ char *mbstrcasestr(const char *haystack, const char *needle) for (; *haystack != '\0' && haystack_len >= needle_len; haystack += move_mbright(haystack, 0), haystack_len--) { - if (mbstrncasecmp(haystack, needle, needle_len) == 0 && - mblen(haystack, MB_CUR_MAX) > 0) + if (mbstrncasecmp(haystack, needle, needle_len) == 0) return (char *)haystack; } @@ -687,8 +686,7 @@ char *mbrevstrcasestr(const char *haystack, const char *needle, const while (TRUE) { if (rev_start_len >= needle_len && - mbstrncasecmp(rev_start, needle, needle_len) == 0 && - mblen(rev_start, MB_CUR_MAX) > 0) + mbstrncasecmp(rev_start, needle, needle_len) == 0) return (char *)rev_start; /* If we've reached the head of the haystack, we found nothing. */