From 7f6dec6dca171e31637719c59754e56ae17e714c Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sat, 25 Sep 2021 09:05:30 +0200 Subject: [PATCH] Fix extra content rendered in dialogs More then just the given line was being plased in the line buffer which caused a lot of double rendering and sometimes also invalid UTF-8 resulting is stray question marks under the text --- Source/minitext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/minitext.cpp b/Source/minitext.cpp index 1d3c1e605..36704fab5 100644 --- a/Source/minitext.cpp +++ b/Source/minitext.cpp @@ -50,7 +50,7 @@ void LoadText(const char *text) size_t previous = 0; while (true) { size_t next = paragraphs.find('\n', previous); - TextLines.emplace_back(paragraphs.substr(previous, next)); + TextLines.emplace_back(paragraphs.substr(previous, next - previous)); if (next == std::string::npos) break; previous = next + 1;