libgnunetchat

library for GNUnet Messenger
Log | Files | Refs | README | LICENSE

commit 87ead322b24027dae30b603db86c71d7d819dda3
parent c557eb484c38e205b251ffcbad14a17c38c2b6d4
Author: TheJackiMonster <thejackimonster@gmail.com>
Date:   Sun,  9 Jan 2022 23:15:09 +0100

Adjusted equations to avoid segfaults

Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>

Diffstat:
Msrc/gnunet_chat_contact.c | 4++--
Msrc/gnunet_chat_context.c | 4++--
Msrc/gnunet_chat_handle.c | 6+++---
Msrc/gnunet_chat_lib.c | 4++--
4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/gnunet_chat_contact.c b/src/gnunet_chat_contact.c @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - Copyright (C) 2021 GNUnet e.V. + Copyright (C) 2021--2022 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -60,7 +60,7 @@ contact_update_key (struct GNUNET_CHAT_Contact *contact) contact->public_key = NULL; - if (!contact->member) + if (!(contact->member)) return; const struct GNUNET_IDENTITY_PublicKey *pubkey; diff --git a/src/gnunet_chat_context.c b/src/gnunet_chat_context.c @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - Copyright (C) 2021 GNUnet e.V. + Copyright (C) 2021--2022 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -151,7 +151,7 @@ context_update_nick (struct GNUNET_CHAT_Context *context, util_set_name_field(nick, &(context->nick)); - if (!context->handle) + if (!(context->handle)) return; handle_send_internal_message( diff --git a/src/gnunet_chat_handle.c b/src/gnunet_chat_handle.c @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - Copyright (C) 2021 GNUnet e.V. + Copyright (C) 2021--2022 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -104,7 +104,7 @@ handle_update_key (struct GNUNET_CHAT_Handle *handle) handle->public_key = NULL; - if (!handle->messenger) + if (!(handle->messenger)) return; const struct GNUNET_IDENTITY_PublicKey *pubkey; @@ -173,7 +173,7 @@ handle_send_internal_message (struct GNUNET_CHAT_Handle *handle, { GNUNET_assert((handle) && (GNUNET_CHAT_FLAG_NONE != flag)); - if (!handle->msg_cb) + if (!(handle->msg_cb)) return; struct GNUNET_CHAT_Message *msg = message_create_internally( diff --git a/src/gnunet_chat_lib.c b/src/gnunet_chat_lib.c @@ -565,7 +565,7 @@ GNUNET_CHAT_context_get_group (const struct GNUNET_CHAT_Context *context) if ((!context) || (GNUNET_CHAT_CONTEXT_TYPE_GROUP != context->type)) return NULL; - if (!context->room) + if (!(context->room)) return NULL; return handle_get_group_from_messenger(context->handle, context->room); @@ -830,7 +830,7 @@ struct GNUNET_CHAT_Contact* GNUNET_CHAT_message_get_sender (const struct GNUNET_CHAT_Message *message) { if ((!message) || (GNUNET_CHAT_FLAG_NONE != message->flag) || - (!message->context) || (!message->context->room)) + (!(message->context)) || (!(message->context->room))) return NULL; const struct GNUNET_MESSENGER_Contact *sender = GNUNET_MESSENGER_get_sender(