[mutter] util: Avoid overriding 'message' in meta_topic()
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] util: Avoid overriding 'message' in meta_topic()
- Date: Fri, 29 Apr 2022 19:27:34 +0000 (UTC)
commit dd6afb28ff5ece0b0995340b68a7fb44570d6afd
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Thu Apr 28 16:10:13 2022 +0200
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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2391>
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 c44a63fc87..c8628bcf9c 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]