diff --git a/src/Cafe/HW/Espresso/Recompiler/IML/IMLRegisterAllocator.cpp b/src/Cafe/HW/Espresso/Recompiler/IML/IMLRegisterAllocator.cpp index 2fb55c80..42fe619b 100644 --- a/src/Cafe/HW/Espresso/Recompiler/IML/IMLRegisterAllocator.cpp +++ b/src/Cafe/HW/Espresso/Recompiler/IML/IMLRegisterAllocator.cpp @@ -1190,7 +1190,7 @@ void _IMLRA_checkAndTryExtendRange(IMLRegisterAllocatorContext& ctx, IMLSegment* { if (routeDepth >= 64) { - forceLogDebug_printf("Recompiler RA route maximum depth exceeded\n"); + cemuLog_logDebug(LogType::Force, "Recompiler RA route maximum depth exceeded\n"); return; } route[routeDepth] = currentSegment; diff --git a/src/util/helpers/StringBuf.h b/src/util/helpers/StringBuf.h index 8b34e54f..6242fa4c 100644 --- a/src/util/helpers/StringBuf.h +++ b/src/util/helpers/StringBuf.h @@ -44,11 +44,9 @@ public: void add(std::string_view appendedStr) { - if (this->length + appendedStr.size() + 1 >= this->limit) - _reserve(std::max(this->length + appendedStr.size() + 64, this->limit + this->limit / 2)); size_t copyLen = appendedStr.size(); - if (remainingLen < copyLen) - copyLen = remainingLen; + if (this->length + copyLen + 1 >= this->limit) + _reserve(std::max(this->length + copyLen + 64, this->limit + this->limit / 2)); char* outputStart = (char*)(this->str + this->length); std::copy(appendedStr.data(), appendedStr.data() + copyLen, outputStart); length += copyLen;