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.
This commit is contained in:
the xhr
2023-01-09 17:58:01 +01:00
parent 6ceafac6aa
commit 714add207b
4 changed files with 11 additions and 5 deletions

View File

@@ -654,7 +654,7 @@ message_send_chat_omemo(const char* const jid, uint32_t sid, GList* keys,
xmpp_stanza_t* key_stanza = xmpp_stanza_new(ctx);
xmpp_stanza_set_name(key_stanza, "key");
char* rid = g_strdup_printf("%d", key->device_id);
log_debug("[OMEMO] Sending to device rid %s", rid == NULL ? "NULL" : rid);
log_debug("[OMEMO] Sending to device rid %s", STR_MAYBE_NULL(rid));
xmpp_stanza_set_attribute(key_stanza, "rid", rid);
g_free(rid);
if (key->prekey) {