From dd6afb28ff5ece0b0995340b68a7fb44570d6afd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 28 Apr 2022 16:10:13 +0200 Subject: [PATCH] util: Avoid overriding 'message' in meta_topic() We'd put the message in a variable called `message`. If something passed to meta_topic() was called `message`, it'd end up being `NULL` in the log entry. Avoid this by making the local message variable a bit more "on topic". Part-of: --- src/meta/util.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/meta/util.h b/src/meta/util.h index c44a63fc8..c8628bcf9 100644 --- a/src/meta/util.h +++ b/src/meta/util.h @@ -175,10 +175,11 @@ const char * meta_topic_to_string (MetaDebugTopic topic); { \ if (meta_is_topic_enabled (debug_topic)) \ { \ - g_autofree char *message = NULL; \ + g_autofree char *_topic_message = NULL; \ \ - message = g_strdup_printf (__VA_ARGS__); \ - g_message ("%s: %s", meta_topic_to_string (debug_topic), message); \ + _topic_message = g_strdup_printf (__VA_ARGS__); \ + g_message ("%s: %s", meta_topic_to_string (debug_topic), \ + _topic_message); \ } \ } \ G_STMT_END