From 6ceafac6aa050f281375cb5d5bc9856a8309450c Mon Sep 17 00:00:00 2001 From: the xhr Date: Fri, 6 Jan 2023 11:48:52 +0100 Subject: [PATCH] Check if string is NULL and print placeholder instead OpenBSD's kernel warns about NULL printfs. Fix this with a standard check. --- src/omemo/omemo.c | 2 +- src/xmpp/omemo.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/omemo/omemo.c b/src/omemo/omemo.c index 87208e9d..442906e2 100644 --- a/src/omemo/omemo.c +++ b/src/omemo/omemo.c @@ -553,7 +553,7 @@ omemo_prekeys(GList** prekeys, GList** ids, GList** lengths) void omemo_set_device_list(const char* const from, GList* device_list) { - log_debug("[OMEMO] Setting device list for %s", from); + log_debug("[OMEMO] Setting device list for %s", (from == NULL) ? "" : from); Jid* jid; if (from) { jid = jid_create(from); diff --git a/src/xmpp/omemo.c b/src/xmpp/omemo.c index c4d82e42..70fdd733 100644 --- a/src/xmpp/omemo.c +++ b/src/xmpp/omemo.c @@ -191,7 +191,7 @@ 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); + log_debug("[OMEMO] omemo_start_device_session_handle_bundle: %s", (from_attr == NULL) ? "" : from_attr); const char* type = xmpp_stanza_get_type(stanza); if (g_strcmp0(type, "error") == 0) {