From fa19e466de338c3a0a6969d260523f35bd12940d Mon Sep 17 00:00:00 2001 From: drmortalwombat Date: Mon, 28 Aug 2023 18:52:14 +0200 Subject: [PATCH] Fix opp string append char --- include/opp/string.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/opp/string.cpp b/include/opp/string.cpp index e9de1c7..b5732a4 100644 --- a/include/opp/string.cpp +++ b/include/opp/string.cpp @@ -211,7 +211,7 @@ string & string::operator+=(char c) p[l] = c; p[l + 1] = 0; free(cstr); - cstr = c; + cstr = p; } else { @@ -220,6 +220,7 @@ string & string::operator+=(char c) cstr[1] = c; cstr[2] = 0; } + return *this; }