From 2a15393d36841175ffc27cac959bbc49af40ff29 Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 2 Dec 2022 09:38:57 +1100 Subject: Ensure variable is initialized. --- src/Document.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') 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(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 -- cgit v1.2.3