Skip to content

Commit

Permalink
Deletes the unnecessary check length >= 1
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasFlamel1 committed Jun 3, 2024
1 parent a8de185 commit d767b00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ bool isValidUtf8String(const char *text, const size_t length) {
}

// Otherwise check if UTF-8 code point is a non-overlong two byte character
else if(length >= 1 && i < length - 1 && text[i] >= 0xC2 && text[i] <= 0xDF && text[i + 1] >= 0x80 && text[i + 1] <= 0xBF) {
else if(i < length - 1 && text[i] >= 0xC2 && text[i] <= 0xDF && text[i + 1] >= 0x80 && text[i + 1] <= 0xBF) {

// Go to next UTF-8 code point
i += 2;
Expand Down

0 comments on commit d767b00

Please sign in to comment.