From f96e4e92ceeb5b36991a2be1b28e07679f0a93da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Thu, 5 Nov 2020 11:57:21 +0100 Subject: [PATCH] [ion/utf8_helper] Fix bad variable use --- ion/src/shared/unicode/utf8_helper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ion/src/shared/unicode/utf8_helper.cpp b/ion/src/shared/unicode/utf8_helper.cpp index 40bf19bb2..731268c3f 100644 --- a/ion/src/shared/unicode/utf8_helper.cpp +++ b/ion/src/shared/unicode/utf8_helper.cpp @@ -203,7 +203,7 @@ void TryAndReplacePatternsInStringByPatterns(char * text, int textMaxLength, Tex size_t replacingStringLength = strlen(replacingString); if (strncmp(&text[i], matchedString, matchedStringLength) == 0) { - didReplace = replaceFirstCharsByPattern(&text[i], matchedStringLength, replacingString, textMaxLength); + didReplace = replaceFirstCharsByPattern(&text[i], matchedStringLength, replacingString, textMaxLength - i); if (didReplace) { int delta = replacingStringLength - matchedStringLength; textLength += delta;