Bug 1449254 - Use vsnprintf for formatting DebugDump() output on Windows, too. r?mrbkap
Since VS2015, vsnprintf is supposed to be C99-compliant on Windows, too and will
especially always null-terminate the string written into the given buffer.
In addition, the build define we were using was misspelled and therefore not
working anyway, so might we as well remove it now.
MozReview-Commit-ID: 44ERI6TUz1B
--- a/js/xpconnect/src/XPCDebug.cpp
+++ b/js/xpconnect/src/XPCDebug.cpp
@@ -18,22 +18,17 @@
#include <windows.h>
#endif
static void DebugDump(const char* fmt, ...)
{
char buffer[2048];
va_list ap;
va_start(ap, fmt);
-#ifdef XPWIN
- _vsnprintf(buffer, sizeof(buffer), fmt, ap);
- buffer[sizeof(buffer)-1] = '\0';
-#else
VsprintfLiteral(buffer, fmt, ap);
-#endif
va_end(ap);
#ifdef ANDROID
__android_log_write(ANDROID_LOG_DEBUG, "Gecko", buffer);
#elif XP_WIN
if (IsDebuggerPresent()) {
OutputDebugStringA(buffer);
}
#endif