summaryrefslogtreecommitdiff
path: root/utf8.h
diff options
context:
space:
mode:
Diffstat (limited to 'utf8.h')
-rw-r--r--utf8.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/utf8.h b/utf8.h
index 419977d..8c6a7a0 100644
--- a/utf8.h
+++ b/utf8.h
@@ -53,8 +53,9 @@ utf8_decode(void *buf, uint32_t *c, int *e)
*c >>= shiftc[len];
/* Accumulate the various error conditions. */
- *e = (*c < mins[len]) << 6;
+ *e = (*c < mins[len]) << 6; // non-canonical encoding
*e |= ((*c >> 11) == 0x1b) << 7; // surrogate half?
+ *e |= (*c > 0x10FFFF) << 8; // out of range?
*e |= (s[1] & 0xc0) >> 2;
*e |= (s[2] & 0xc0) >> 4;
*e |= (s[3] ) >> 6;