From f2569b9423dab5bace329ccca21c1ff967a86c74 Mon Sep 17 00:00:00 2001 From: Laurence Withers Date: Wed, 14 Oct 2009 15:24:08 +0000 Subject: [PATCH] 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. --- src/libutf8/200_decode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libutf8/200_decode.c b/src/libutf8/200_decode.c index f01b7e0..f1bc920 100644 --- a/src/libutf8/200_decode.c +++ b/src/libutf8/200_decode.c @@ -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; }