From 77bd8913d3e5822c3d17cad17059228e3acaf22d Mon Sep 17 00:00:00 2001 From: Leonetienne Date: Sat, 12 Feb 2022 04:19:42 +0100 Subject: Fixed issue twat caused some text to be lost duwing kawaisation --- main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index 9bf8b2f..717b943 100644 --- a/main.cpp +++ b/main.cpp @@ -177,8 +177,8 @@ std::string ReplaceButKeepSigns( } else { - // We do not have an occurrence... just insert the char as is - ss << str[i]; + // We do not have an occurrence... just insert the subsection found as is (next iteration will start behind it) + ss << foundInText; } // Advance i accordingly @@ -304,7 +304,8 @@ std::string MakeUwu(std::string boringString) { "ll", "ww", [boringString](const std::string &found, int index) { - if (boringString.length() < found.length()) + // Don't replace, if we are on the last char + if (index + found.length() == boringString.length() - 1) return false; const char nextChar = MakeLower(boringString[index + found.length()]); -- cgit v1.2.3