From 6cfc4f283c8e068bc1345c46149b90a86be40a2f Mon Sep 17 00:00:00 2001 From: Amlal EL Mahrouss Date: Mon, 29 Jul 2024 11:52:08 +0200 Subject: [MHR-37] Last commit on ticket. Signed-off-by: Amlal EL Mahrouss --- Kernel/Sources/String.cxx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'Kernel/Sources/String.cxx') diff --git a/Kernel/Sources/String.cxx b/Kernel/Sources/String.cxx index 2ed52029..8d4c7930 100644 --- a/Kernel/Sources/String.cxx +++ b/Kernel/Sources/String.cxx @@ -214,7 +214,7 @@ namespace Kernel return ret; } - STATIC void rt_string_append(Char* lhs, Char* rhs, Int cur) + STATIC void rt_string_append(Char* lhs, const Char* rhs, Int32 cur) { SizeT sz_rhs = rt_string_len(rhs); SizeT rhs_i = 0; @@ -223,16 +223,11 @@ namespace Kernel { lhs[rhs_i + cur] = rhs[rhs_i]; } - - lhs[rhs_i + cur] = 0; } StringView& StringView::operator+=(const Char* rhs) { - if (rt_string_len(rhs) > this->Length()) - return *this; - - rt_string_append(this->fData, const_cast(rhs), this->fCur); + rt_string_append(this->fData, rhs, this->fCur); this->fCur += rt_string_len(rhs); return *this; -- cgit v1.2.3