From 88b935bb0c0c31523fa34cbec389b8200d91a8c9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marcin=20=C5=9Alusarz?= Date: Mon, 24 Aug 2020 21:13:50 +0200 Subject: [PATCH] mesa: fix formatting of messages printed using _mesa_log MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ... on BOTH _WIN32 and !_WIN32 Signed-off-by: Marcin Ślusarz Reviewed-by: Danylo Piliaiev Part-of: --- src/mesa/main/errors.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/errors.c b/src/mesa/main/errors.c index 91988f183f8..02517c1c407 100644 --- a/src/mesa/main/errors.c +++ b/src/mesa/main/errors.c @@ -86,7 +86,10 @@ output_if_debug(const char *prefixString, const char *outputString, * visible, so communicate with the debugger instead */ { char buf[4096]; - snprintf(buf, sizeof(buf), "%s: %s%s", prefixString, outputString, newline ? "\n" : ""); + if (prefixString) + snprintf(buf, sizeof(buf), "%s: %s%s", prefixString, outputString, newline ? "\n" : ""); + else + snprintf(buf, sizeof(buf), "%s%s", outputString, newline ? "\n" : ""); OutputDebugStringA(buf); } #endif @@ -399,7 +402,7 @@ _mesa_log(const char *fmtString, ...) va_start(args, fmtString); vsnprintf(s, MAX_DEBUG_MESSAGE_LENGTH, fmtString, args); va_end(args); - output_if_debug("", s, GL_FALSE); + output_if_debug(NULL, s, GL_FALSE); } -- 2.30.2