From ee1f85ff272bd65c407077d068ab8c8e021a9d8c Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 9 Feb 2016 19:25:08 +0100 Subject: [PATCH] Composition of the trailing sequence fixed --- lib/libZRCola/src/compose.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libZRCola/src/compose.cpp b/lib/libZRCola/src/compose.cpp index a1d8420..08c9dd4 100644 --- a/lib/libZRCola/src/compose.cpp +++ b/lib/libZRCola/src/compose.cpp @@ -82,7 +82,7 @@ static inline void Compose( if (l >= r) { // 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. output += compositions[l_prev].dst; i = ii; @@ -100,7 +100,7 @@ static inline void Compose( } else { // 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. output += compositions[l].dst; i = ii;