Skip to content

Commit

Permalink
appease MSVC C2131
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteven4 committed Nov 2, 2024
1 parent 86275ba commit cfc576c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fatal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@ int DebugLog::vlog(const char* fmt, va_list args1)
{
va_list args2;
va_copy(args2, args1);
char cbuf[1 + vsnprintf(nullptr, 0, fmt, args1)];
vsnprintf(cbuf, sizeof cbuf, fmt, args2);
size_t cbufsz = 1 + vsnprintf(nullptr, 0, fmt, args1);
char* cbuf = new char[cbufsz];
vsnprintf(cbuf, cbufsz, fmt, args2);
va_end(args2);

buf_.append(QString::asprintf("%s", cbuf));
delete[] cbuf;

int rc = 0;

Expand Down

0 comments on commit cfc576c

Please sign in to comment.