Skip to content

Commit

Permalink
Fix warning comparing signed and unsigned int
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrodriguez-dis committed Jun 6, 2024
1 parent 52f73e3 commit d21ba36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ class Util{
else if ((c >> 3) == 0b11110) num_bytes = 4; // 4-byte sequence
else if ((c >> 7)) return -1; // Unexpected continuation or invalid byte
if (pos + num_bytes > text.size()) return -1;
for (size_t i = 1; i < num_bytes; i++) {
for (int i = 1; i < num_bytes; i++) {
c = text[pos + i];
if ((c >> 6) != 0b10) return -(i + 1); // Ignore bad bytes
}
Expand Down

0 comments on commit d21ba36

Please sign in to comment.