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

@@ -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 == NULL) ? "" : from);
log_debug("[OMEMO] Setting device list for %s", STR_MAYBE_NULL(from));
Jid* jid;
if (from) {
jid = jid_create(from);
@@ -570,7 +570,7 @@ omemo_set_device_list(const char* const from, GList* device_list)
g_hash_table_remove(omemo_ctx.device_list_handler, jid->barejid);
}
} else {
log_debug("[OMEMO] No Device List Handler for %s", from);
log_debug("[OMEMO] No Device List Handler for %s", STR_MAYBE_NULL(from));
}
// OMEMO trustmode ToFu