LibC: Don't clobber errno in dbgprintf().

This commit is contained in:
Andreas Kling 2019-05-16 16:24:22 +02:00
parent f1f3cd58b0
commit e20aecefba

View file

@ -295,10 +295,12 @@ int dbgprintf(const char* fmt, ...)
{
// if this fails, you're printing too early.
ASSERT(stddbg);
int errno_backup = errno;
va_list ap;
va_start(ap, fmt);
int ret = vfprintf(stddbg, fmt, ap);
va_end(ap);
errno = errno_backup;
return ret;
}