From a807144ead497385572b4af461f240422a517ef8 Mon Sep 17 00:00:00 2001
From: florian <florian@freepascal.org>
Date: Tue, 4 Apr 2023 23:21:14 +0200
Subject: [PATCH]   * patch by Rika: Fix and possible simplification of
 SanitiseXMLString, part of #39800

---
 compiler/verbose.pas | 1 +
 1 file changed, 1 insertion(+)

diff --git a/compiler/verbose.pas b/compiler/verbose.pas
index 7f6716626c..12f85153ae 100644
--- a/compiler/verbose.pas
+++ b/compiler/verbose.pas
@@ -1267,6 +1267,7 @@ implementation
                           begin
                             UTF8Char := UTF8Char or ((CurrentChar and $3F) shl (6 * UTF8Len));
 
+                            dec(X);
                             Inc(UTF8Len);
                             if UTF8Len >= 4 then
                               { Sequence too long }