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:
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user