summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-16 12:33:11 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-16 12:33:11 -0500
commit824c4ff4be5a0bf55b6644fed06fcfe2248c4301 (patch)
tree0eb56394e769e23005a9f03ffea0557c2577e542 /util.c
parent4bde24cb63313f636ac72b449f54d68515efe485 (diff)
started getting :build to work
Diffstat (limited to 'util.c')
-rw-r--r--util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util.c b/util.c
index 73f1e02..0e07b25 100644
--- a/util.c
+++ b/util.c
@@ -164,7 +164,7 @@ static char *stristr(char const *haystack, char const *needle) {
char32_t pchar = 0, qchar = 0;
size_t bytes_p = unicode_utf8_to_utf32(&pchar, p, (size_t)(haystack_end - p));
size_t bytes_q = unicode_utf8_to_utf32(&qchar, q, (size_t)(needle_end - q));
- if (bytes_p == (size_t)-1 || bytes_q == (size_t)-1) return NULL; // invalid UTF-8
+ if (bytes_p >= (size_t)-2 || bytes_q >= (size_t)-2) return NULL; // invalid UTF-8
bool same = pchar == qchar;
if (pchar < WINT_MAX && qchar < WINT_MAX) // on Windows, there is no way of finding the lower-case version of a codepoint outside the BMP. ):
same = towlower((wint_t)pchar) == towlower((wint_t)qchar);