Fix implicit casting of -1 to size_t

This commit is contained in:
blankhex committed 2026-07-02 11:20:46 +03:00
1 parent 9e9f457a57
commit 01ed58f172
1 file changed
+2 -2
+2 -2
View File
@@ -173,7 +173,7 @@ size_t CgeStrIndexRune(const CgeStr *str, uint32_t rune) {
CgeStr tmp;
tmp.data = scratch;
if ((tmp.size = CgeUtf8Encode(rune, scratch)) == -1)
if ((tmp.size = CgeUtf8Encode(rune, scratch)) == (size_t)-1)
return (size_t)-1;
return CgeStrIndexStr(str, &tmp);
@@ -184,7 +184,7 @@ size_t CgeStrLastIndexRune(const CgeStr *str, uint32_t rune) {
CgeStr tmp;
tmp.data = scratch;
if ((tmp.size = CgeUtf8Encode(rune, scratch)) == -1)
if ((tmp.size = CgeUtf8Encode(rune, scratch)) == (size_t)-1)
return (size_t)-1;
return CgeStrLastIndexStr(str, &tmp);