From 4682deeb62247d34de87f8e777f99e2d337fd377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 20 Oct 2024 15:21:43 +0200 Subject: New upstream version 1.3 --- lib/unictype/scripts.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/unictype/scripts.c') diff --git a/lib/unictype/scripts.c b/lib/unictype/scripts.c index a226d8da..1d9d13aa 100644 --- a/lib/unictype/scripts.c +++ b/lib/unictype/scripts.c @@ -35,11 +35,11 @@ uc_script (ucs4_t uc) if (lookup1 >= 0) { unsigned int index2 = (uc >> script_header_2) & script_header_3; - int lookup2 = u_script.level2[lookup1 + index2]; - if (lookup2 >= 0) + unsigned int lookup2 = u_script.level2[lookup1 + index2]; + if (lookup2 > 0) { unsigned int index3 = (uc & script_header_4); - unsigned char lookup3 = u_script.level3[lookup2 + index3]; + unsigned char lookup3 = u_script.level3[(lookup2 - 1) + index3]; if (lookup3 != 0xff) return &scripts[lookup3]; -- cgit v1.2.3