unicode: fix handling of short 1-4 char tables
function old new delta in_uint16_table 92 107 +15 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
eb773054e4
commit
33e955ab91
2 changed files with 4 additions and 3 deletions
|
@ -306,8 +306,10 @@ static int in_uint16_table(unsigned ucs, const uint16_t *table, unsigned max)
|
|||
unsigned first, last;
|
||||
|
||||
first = table[0] >> 2;
|
||||
last = first + (table[0] & 3);
|
||||
if (ucs < first || ucs > last)
|
||||
if (ucs < first)
|
||||
return 0;
|
||||
last = (table[max] >> 2) + (table[max] & 3);
|
||||
if (ucs > last)
|
||||
return 0;
|
||||
|
||||
min = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue