From 69fd473321c4a81ee08605cd16eb7692dd9fe25b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Mon, 18 May 2015 09:05:11 -0700 Subject: [PATCH] vk: Use a temporary buffer for formatting in finishme This is more likely to avoid breaking up the message when racing with other threads. --- src/vulkan/util.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/vulkan/util.c b/src/vulkan/util.c index 92f9e407684..082499d6093 100644 --- a/src/vulkan/util.c +++ b/src/vulkan/util.c @@ -34,12 +34,13 @@ void __anv_finishme(const char *file, int line, const char *format, ...) { va_list ap; + char buffer[256]; va_start(ap, format); - fprintf(stderr, "%s:%d: FINISHME: ", file, line); - vfprintf(stderr, format, ap); - fprintf(stderr, "\n"); + vsnprintf(buffer, sizeof(buffer), format, ap); va_end(ap); + + fprintf(stderr, "%s:%d: FINISHME: %s\n", file, line, buffer); } int -- 2.30.2