mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-22 09:09:18 +01:00
Fix StringBuf.add()
This commit is contained in:
parent
504e0488a8
commit
9fb8f4cb6b
@ -46,10 +46,11 @@ public:
|
||||
{
|
||||
size_t remainingLen = this->limit - this->length;
|
||||
size_t copyLen = appendedStr.size();
|
||||
if (remainingLen > copyLen)
|
||||
if (remainingLen < copyLen)
|
||||
copyLen = remainingLen;
|
||||
char* outputStart = (char*)(this->str + this->length);
|
||||
std::copy(appendedStr.data(), appendedStr.data() + copyLen, outputStart);
|
||||
length += copyLen;
|
||||
outputStart[copyLen] = '\0';
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user