From 95fef934c1feb0d93f0bf6e649e7f4bc7e3cfa64 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sat, 20 Nov 2021 18:57:23 +0100 Subject: [PATCH] Correctly cut up lines Fixes #3558 --- Source/error.cpp | 2 +- Source/help.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/error.cpp b/Source/error.cpp index ca952fa28..01a23c433 100644 --- a/Source/error.cpp +++ b/Source/error.cpp @@ -40,7 +40,7 @@ void InitNextLines() 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; diff --git a/Source/help.cpp b/Source/help.cpp index c4822d070..0fa90598b 100644 --- a/Source/help.cpp +++ b/Source/help.cpp @@ -158,7 +158,7 @@ void InitHelp() size_t previous = 0; while (true) { size_t next = paragraph.find('\n', previous); - HelpTextLines.emplace_back(paragraph.substr(previous, next)); + HelpTextLines.emplace_back(paragraph.substr(previous, next - previous)); if (next == std::string::npos) break; previous = next + 1;