From 2426a7fcfcfa2ee4e5ab0f9300e7d5296170f893 Mon Sep 17 00:00:00 2001 From: James Booth Date: Mon, 4 May 2015 22:55:04 +0100 Subject: [PATCH] Use null check convention in otrlibv3.c --- src/otr/otrlibv3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/otr/otrlibv3.c b/src/otr/otrlibv3.c index 77b0ee77..0b81796c 100644 --- a/src/otr/otrlibv3.c +++ b/src/otr/otrlibv3.c @@ -87,7 +87,7 @@ otrlib_end_session(OtrlUserState user_state, const char * const recipient, char ConnContext *context = otrl_context_find(user_state, recipient, jid, "xmpp", 0, NULL, NULL, NULL); - if (context != NULL) { + if (context) { otrl_message_disconnect(user_state, ops, NULL, jid, "xmpp", recipient); } } @@ -171,7 +171,7 @@ otrlib_handle_tlvs(OtrlUserState user_state, OtrlMessageAppOps *ops, ConnContext } else { context->smstate->nextExpected = OTRL_SMP_EXPECT1; if (context->smstate->received_question == 0) { - if ((context->active_fingerprint->trust != NULL) && (context->active_fingerprint->trust[0] != '\0')) { + if (context->active_fingerprint->trust && (context->active_fingerprint->trust[0] != '\0')) { ui_smp_successful(context->username); ui_trust(context->username); } else { @@ -193,7 +193,7 @@ otrlib_handle_tlvs(OtrlUserState user_state, OtrlMessageAppOps *ops, ConnContext otrl_message_abort_smp(user_state, ops, NULL, context); } else { context->smstate->nextExpected = OTRL_SMP_EXPECT1; - if ((context->active_fingerprint->trust != NULL) && (context->active_fingerprint->trust[0] != '\0')) { + if (context->active_fingerprint->trust && (context->active_fingerprint->trust[0] != '\0')) { ui_smp_successful(context->username); ui_trust(context->username); } else {