Changes to DBG_printf (dotnet/coreclr#20383)
authorJonathan Marler <johnnymarler@gmail.com>
Tue, 12 Nov 2019 21:05:00 +0000 (14:05 -0700)
committerJan Vorlicek <janvorli@microsoft.com>
Tue, 12 Nov 2019 21:05:00 +0000 (22:05 +0100)
commitd1fa566bc27177863124ed8aa918fd45753a376f
treef88e94bbd58a1b34d7c323f23826eee2fe30df13
parent772accd3c613bf61eba09100facd7e51f1f31276
Changes to DBG_printf (dotnet/coreclr#20383)

1. will now restore the original errno in all cases
2. combine the snprintf calls in the if(bHeader) block, the only difference was the file/function string
3. we now check the return value of snprintf and _vsnprintf_s instead of ignoring them.  When sprintf fails for the header, we just drop the header, when _vsnprintf_s fails for the message itself, we print an error.
4. replaced an alloca with a statically sized buffer

Commit migrated from https://github.com/dotnet/coreclr/commit/cec441660fb12bd48dab3e4f234d5a6315121aa0
src/coreclr/src/pal/src/misc/dbgmsg.cpp