From 85875d81304f300e954e929f936b652d1230349b Mon Sep 17 00:00:00 2001 From: NaifBanana <30419422+NaifBanana@users.noreply.github.com> Date: Mon, 10 Nov 2025 00:42:31 -0600 Subject: [PATCH] Made code more nice to look at (to me) --- include/Errors.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/Errors.hpp b/include/Errors.hpp index 42d67a9..7ba07f0 100644 --- a/include/Errors.hpp +++ b/include/Errors.hpp @@ -87,10 +87,9 @@ protected: std::string filename="" ) noexcept : ErrorBase(code, msg, line, filename) { std::string what_msg(trace.what()); - std::string::size_type newline_pos = what_msg.find("\n"); - while(newline_pos != std::string::npos) { + std::string::size_type newline_pos=-1; + while((newline_pos=what_msg.find("\n", newline_pos+1))!= std::string::npos) { what_msg.replace(newline_pos, 1, "\n "); - newline_pos = what_msg.find("\n", newline_pos+1); } _msg += "\n Trace: " + what_msg; }