Composition of the trailing sequence fixed

This commit is contained in:
Simon Rozman 2016-02-09 19:25:08 +01:00
parent 38639a8716
commit ee1f85ff27

View File

@ -82,7 +82,7 @@ static inline void Compose(
if (l >= r) { if (l >= r) {
// The search area is empty. // The search area is empty.
if (j && wcslen(compositions[l_prev].src) == j) { if (j && l_prev < compositionsCount && compositions[l_prev].src[j] == 0) {
// The first composition of the previous run was a match. // The first composition of the previous run was a match.
output += compositions[l_prev].dst; output += compositions[l_prev].dst;
i = ii; i = ii;
@ -100,7 +100,7 @@ static inline void Compose(
} else { } else {
// End of input reached. // End of input reached.
if (l && wcslen(compositions[l - 1].src) == j) { if (l < compositionsCount && compositions[l].src[j] == 0) {
// The first composition of the previous run was a match. // The first composition of the previous run was a match.
output += compositions[l].dst; output += compositions[l].dst;
i = ii; i = ii;