Commit 518ff48f authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Instance: Account for null terminating byte

parent 109ff137
......@@ -197,8 +197,8 @@ public:
int len = vsnprintf(nullptr, 0, format, vaCopy.va);
if (len > 0)
{
std::unique_ptr<char[]> message{ new char[len] };
if (vsnprintf(message.get(), len, format, va) != -1)
std::unique_ptr<char[]> message{ new char[len + 1] };
if (vsnprintf(message.get(), len + 1, format, va) != -1)
logCb(level, ctx, std::string{ message.get() });
}
#else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment