summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/xkbcommon/src/utf8.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/xkbcommon/src/utf8.c')
-rw-r--r--src/3rdparty/xkbcommon/src/utf8.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/3rdparty/xkbcommon/src/utf8.c b/src/3rdparty/xkbcommon/src/utf8.c
index 11382c809d..a76b001bab 100644
--- a/src/3rdparty/xkbcommon/src/utf8.c
+++ b/src/3rdparty/xkbcommon/src/utf8.c
@@ -49,17 +49,13 @@ utf32_to_utf8(uint32_t unichar, char *buffer)
length = 3;
head = 0xe0;
}
- else if (unichar <= 0x1fffff) {
+ else if (unichar <= 0x10ffff) {
length = 4;
head = 0xf0;
}
- else if (unichar <= 0x3ffffff) {
- length = 5;
- head = 0xf8;
- }
else {
- length = 6;
- head = 0xfc;
+ buffer[0] = '\0';
+ return 0;
}
for (count = length - 1, shift = 0; count > 0; count--, shift += 6)
@@ -80,7 +76,7 @@ is_valid_utf8(const char *ss, size_t len)
/* This beauty is from:
* The Unicode Standard Version 6.2 - Core Specification, Table 3.7
- * http://www.unicode.org/versions/Unicode6.2.0/ch03.pdf#G7404
+ * https://www.unicode.org/versions/Unicode6.2.0/ch03.pdf#G7404
* We can optimize if needed. */
while (i < len)
{