From c9f1802f8f5a1b2b0b1d7f40a4140becb61bd193 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Mon, 21 Jul 2025 12:20:08 -0400 Subject: Fix read one past the end of token list in the line formatter --- formatter/generic/genericformatter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'formatter/generic/genericformatter.cpp') diff --git a/formatter/generic/genericformatter.cpp b/formatter/generic/genericformatter.cpp index 063acecf..e73a630a 100644 --- a/formatter/generic/genericformatter.cpp +++ b/formatter/generic/genericformatter.cpp @@ -967,7 +967,7 @@ vector GenericLineFormatter::FormatLines( { case BraceToken: // Beginning of string - if (trimmedText == "\"" && tokenIndex + 1 <= currentLine.tokens.size() && currentLine.tokens[tokenIndex + 1].type == StringToken) + if (trimmedText == "\"" && tokenIndex + 1 < currentLine.tokens.size() && currentLine.tokens[tokenIndex + 1].type == StringToken) { // Create a ContainerContents item and place it onto the item stack. This will hold anything // inside the container once the end of the container is found. -- cgit v1.3.1