Skip to content
Snippets Groups Projects
collator_range.patch 622 B
Newer Older
diff --git a/source/i18n/collationweights.cpp b/source/i18n/collationweights.cpp
index c60da2d8..05458962 100644
--- a/source/i18n/collationweights.cpp
+++ b/source/i18n/collationweights.cpp
@@ -527,7 +527,7 @@ CollationWeights::allocWeights(uint32_t lowerLimit, uint32_t upperLimit, int32_t
 #ifdef UCOL_DEBUG
         printf("lengthen the short ranges from %ld bytes to %ld and iterate\n", minLength, minLength+1);
 #endif
-        for(int32_t i=0; ranges[i].length==minLength; ++i) {
+        for(int32_t i=0; i<rangeCount && ranges[i].length==minLength; ++i) {
             lengthenRange(ranges[i]);
         }
     }