diff --git a/packages/logging/include/logging/String.h b/packages/logging/include/logging/String.h index cc31a93..0c67f9e 100644 --- a/packages/logging/include/logging/String.h +++ b/packages/logging/include/logging/String.h @@ -36,19 +36,19 @@ namespace string { } ~stackstring() = default; - stackstring(const stackstring& other) { + stackstring(const stackstring& other) : stackstring() { auto size = other.mSize <= mSize ? other.mSize : mSize; - memcpy(mBuf, other.mBuf, size); + memcpy(mBufPtr, &other.mBufPtr, size); mBuf[size] = 0; } stackstring& operator=(const stackstring& other) { auto size = other.mSize <= mSize ? other.mSize : mSize; - memcpy(mBuf, other.mBuf, size); + memcpy(mBufPtr, other.mBufPtr, size); mBuf[size] = 0; return *this; } protected: - char mBuf[size]; + char mBuf[SIZE]; }; int32_t get_local_timezone();