From bbbfd60bb7c9aa30d9c394f7e958f6d43bb2a7b2 Mon Sep 17 00:00:00 2001 From: Tobi Date: Mon, 14 Nov 2022 18:25:24 +0100 Subject: [PATCH] Fix To Prevent from Crash --- source/StealConsole.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/StealConsole.cpp b/source/StealConsole.cpp index 21217b8..64812f9 100644 --- a/source/StealConsole.cpp +++ b/source/StealConsole.cpp @@ -13,5 +13,12 @@ StealConsole::~StealConsole() { // Do Nothing Here } -std::string StealConsole::GetStdout() { return this->stolen_stdout.str(); } +std::string StealConsole::GetStdout() { + if (this->stolen_stdout.str().length() < 400) { + return this->stolen_stdout.str(); + } else { + return this->stolen_stdout.str().substr(stolen_stdout.str().length() - 400); + } + return ""; +} } // namespace RenderD7 \ No newline at end of file