aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2022-12-02 09:38:57 +1100
committerNeil <nyamatongwe@gmail.com>2022-12-02 09:38:57 +1100
commit2a15393d36841175ffc27cac959bbc49af40ff29 (patch)
treef28c8d9416a6fdac6ce74c1ab146db59d376fda0
parent312b3bc50a7d8de832b1a8681644ba4681a9a598 (diff)
downloadscintilla-mirror-2a15393d36841175ffc27cac959bbc49af40ff29.tar.gz
Ensure variable is initialized.
-rw-r--r--src/Document.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Document.cxx b/src/Document.cxx
index 7afe10701..3fd9ce1a9 100644
--- a/src/Document.cxx
+++ b/src/Document.cxx
@@ -2265,9 +2265,10 @@ Sci::Position Document::FindText(Sci::Position minPos, Sci::Position maxPos, con
if (widthChar == 1) {
characterMatches = searchThing[indexSearch] == MakeLowerCase(leadByte);
} else {
- char bytes[maxBytesCharacter + 1];
- bytes[0] = leadByte;
- bytes[1] = cbView.CharAt(pos + indexDocument + 1);
+ const char bytes[maxBytesCharacter + 1] {
+ static_cast<char>(leadByte),
+ cbView.CharAt(pos + indexDocument + 1)
+ };
char folded[maxBytesCharacter * maxFoldingExpansion + 1];
lenFlat = pcf->Fold(folded, sizeof(folded), bytes, widthChar);
// memcmp may examine lenFlat bytes in both arguments so assert it doesn't read past end of searchThing