Mesa (master): mesa: fix formatting of messages printed using _mesa_log
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Aug 25 09:27:03 UTC 2020
Module: Mesa
Branch: master
Commit: 88b935bb0c0c31523fa34cbec389b8200d91a8c9
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=88b935bb0c0c31523fa34cbec389b8200d91a8c9
Author: Marcin Ślusarz <marcin.slusarz at intel.com>
Date: Mon Aug 24 21:13:50 2020 +0200
mesa: fix formatting of messages printed using _mesa_log
... on BOTH _WIN32 and !_WIN32
Signed-off-by: Marcin Ślusarz <marcin.slusarz at intel.com>
Reviewed-by: Danylo Piliaiev <danylo.piliaiev at globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6443>
---
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);
}
More information about the mesa-commit
mailing list