diff options
Diffstat (limited to 'lib/unictype/scripts.c')
-rw-r--r-- | lib/unictype/scripts.c | 6 |
1 files changed, 3 insertions, 3 deletions
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]; |