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>
This commit is contained in:
parent
70ab4b6519
commit
dd6afb28ff
@ -175,10 +175,11 @@ const char * meta_topic_to_string (MetaDebugTopic topic);
|
|||||||
{ \
|
{ \
|
||||||
if (meta_is_topic_enabled (debug_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__); \
|
_topic_message = g_strdup_printf (__VA_ARGS__); \
|
||||||
g_message ("%s: %s", meta_topic_to_string (debug_topic), message); \
|
g_message ("%s: %s", meta_topic_to_string (debug_topic), \
|
||||||
|
_topic_message); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
G_STMT_END
|
G_STMT_END
|
||||||
|
Loading…
Reference in New Issue
Block a user