summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenito van der Zander <benito@benibela.de>2018-04-27 14:06:14 +0200
committerSteven G. Johnson <stevenj@mit.edu>2018-04-27 08:06:14 -0400
commitacc204f1f15e879331c95096b6d4fac8bc2c906f (patch)
tree63c3a17049638bf9ffb88e236d5570e71ddeedb5
parent6a20831a07486dff584ff77f315336d110202bbe (diff)
downloadlibutf8proc-acc204f1f15e879331c95096b6d4fac8bc2c906f.tar.gz
libutf8proc-acc204f1f15e879331c95096b6d4fac8bc2c906f.tar.bz2
possible fix for #128 (#129)
Does this help? I do not really remember what I wrote back then
-rw-r--r--utf8proc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/utf8proc.c b/utf8proc.c
index 6961e4b..c0f84d9 100644
--- a/utf8proc.c
+++ b/utf8proc.c
@@ -631,9 +631,9 @@ UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_normalize_utf32(utf8proc_int32_t *b
current_property->comb_index != UINT16_MAX &&
current_property->comb_index >= 0x8000) {
int sidx = starter_property->comb_index;
- int idx = (current_property->comb_index & 0x3FFF) - utf8proc_combinations[sidx];
- if (idx >= 0 && idx <= utf8proc_combinations[sidx + 1] ) {
- idx += sidx + 2;
+ int idx = current_property->comb_index & 0x3FFF;
+ if (idx >= utf8proc_combinations[sidx] && idx <= utf8proc_combinations[sidx + 1] ) {
+ idx += sidx + 2 - utf8proc_combinations[sidx];
if (current_property->comb_index & 0x4000) {
composition = (utf8proc_combinations[idx] << 16) | utf8proc_combinations[idx+1];
} else