From 714add207b26e8d80e3ca945f111bfd5d6027c88 Mon Sep 17 00:00:00 2001 From: the xhr Date: Mon, 9 Jan 2023 17:58:01 +0100 Subject: Add macro for possible NULL prints and use it on known sports The macro is effective on OpenBSD and basically a no op on other platforms. Use it for one existing and the other known debug statements. --- src/xmpp/omemo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/xmpp/omemo.c') diff --git a/src/xmpp/omemo.c b/src/xmpp/omemo.c index 70fdd733..e1bdbc3e 100644 --- a/src/xmpp/omemo.c +++ b/src/xmpp/omemo.c @@ -191,11 +191,11 @@ omemo_start_device_session_handle_bundle(xmpp_stanza_t* const stanza, void* cons char* from = NULL; const char* from_attr = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_FROM); - log_debug("[OMEMO] omemo_start_device_session_handle_bundle: %s", (from_attr == NULL) ? "" : from_attr); + log_debug("[OMEMO] omemo_start_device_session_handle_bundle: %s", STR_MAYBE_NULL(from_attr)); const char* type = xmpp_stanza_get_type(stanza); if (g_strcmp0(type, "error") == 0) { - log_error("[OMEMO] Error to get key for a device from : %s", from_attr); + log_error("[OMEMO] Error to get key for a device from : %s", STR_MAYBE_NULL(from_attr)); } if (!from_attr) { -- cgit 1.4.1-2-gfad0