mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-14 03:10:30 +01:00
dns: fix _NMLOG() macro
The buffer was too small to contain _NMLOG_PREFIX_NAME and the pointer, resulting in truncated messages like: dns-mgr[0x561d1183d: set resolv-conf-mode: none
This commit is contained in:
parent
3bcc0e5cea
commit
4faaa3eb0b
1 changed files with 5 additions and 8 deletions
|
|
@ -100,14 +100,11 @@ NM_DEFINE_SINGLETON_INSTANCE (NMDnsManager);
|
|||
const NMDnsManager *const __self = (self); \
|
||||
\
|
||||
_nm_log (__level, _NMLOG_DOMAIN, 0, \
|
||||
"%s: " _NM_UTILS_MACRO_FIRST (__VA_ARGS__), \
|
||||
((__self == singleton_instance) \
|
||||
? _NMLOG_PREFIX_NAME \
|
||||
: ({ \
|
||||
g_snprintf (__prefix, sizeof (__prefix), "%s[%p]", _NMLOG_PREFIX_NAME, __self); \
|
||||
__prefix; \
|
||||
}) \
|
||||
) \
|
||||
"%s%s: " _NM_UTILS_MACRO_FIRST (__VA_ARGS__), \
|
||||
_NMLOG_PREFIX_NAME, \
|
||||
((!__self || __self == singleton_instance) \
|
||||
? "" \
|
||||
: nm_sprintf_buf (__prefix, "[%p]", __self)) \
|
||||
_NM_UTILS_MACRO_REST (__VA_ARGS__)); \
|
||||
} \
|
||||
} G_STMT_END
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue