summaryrefslogtreecommitdiffhomepage
path: root/Kernel/Sources/String.cxx
diff options
context:
space:
mode:
authorAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-07-29 11:52:08 +0200
committerAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-07-29 11:52:08 +0200
commit6cfc4f283c8e068bc1345c46149b90a86be40a2f (patch)
treeabe3318b61ee43e3b8d4c9893201f78152ad62f4 /Kernel/Sources/String.cxx
parent0d661d2587046d3fc078bc15a089b94489c08a8d (diff)
[MHR-37] Last commit on ticket.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Kernel/Sources/String.cxx')
-rw-r--r--Kernel/Sources/String.cxx9
1 files changed, 2 insertions, 7 deletions
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<Char*>(rhs), this->fCur);
+ rt_string_append(this->fData, rhs, this->fCur);
this->fCur += rt_string_len(rhs);
return *this;