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;