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:
Laurence Withers 2009-10-14 15:24:08 +00:00
parent 21ba875738
commit f2569b9423
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}