utf8_decode_char2(): fix overlength char test
The test for an overlength character was incorrect; it was comparing only the last byte decoded rather than the whole char. Fix it.
This commit is contained in:
parent
21ba875738
commit
f2569b9423
|
@ -74,7 +74,7 @@ utf8_decode_char2(const char* src, size_t size, size_t* used)
|
|||
ret |= ch & 0x3F;
|
||||
}
|
||||
|
||||
if(ch < min) {
|
||||
if(ret < min) {
|
||||
errno = EILSEQ;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue