diff options
author | TheJackiMonster <thejackimonster@gmail.com> | 2022-01-09 23:15:09 +0100 |
---|---|---|
committer | TheJackiMonster <thejackimonster@gmail.com> | 2022-01-09 23:15:09 +0100 |
commit | 87ead322b24027dae30b603db86c71d7d819dda3 (patch) | |
tree | 95488910d566cdf5675aacbfe8ed554d4e69cb4e | |
parent | c557eb484c38e205b251ffcbad14a17c38c2b6d4 (diff) | |
download | libgnunetchat-87ead322b24027dae30b603db86c71d7d819dda3.tar.gz libgnunetchat-87ead322b24027dae30b603db86c71d7d819dda3.zip |
Adjusted equations to avoid segfaults
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
-rw-r--r-- | src/gnunet_chat_contact.c | 4 | ||||
-rw-r--r-- | src/gnunet_chat_context.c | 4 | ||||
-rw-r--r-- | src/gnunet_chat_handle.c | 6 | ||||
-rw-r--r-- | src/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 index 273f917..1f88cad 100644 --- a/src/gnunet_chat_contact.c +++ b/src/gnunet_chat_contact.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2021 GNUnet e.V. | 3 | Copyright (C) 2021--2022 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
@@ -60,7 +60,7 @@ contact_update_key (struct GNUNET_CHAT_Contact *contact) | |||
60 | 60 | ||
61 | contact->public_key = NULL; | 61 | contact->public_key = NULL; |
62 | 62 | ||
63 | if (!contact->member) | 63 | if (!(contact->member)) |
64 | return; | 64 | return; |
65 | 65 | ||
66 | const struct GNUNET_IDENTITY_PublicKey *pubkey; | 66 | const struct GNUNET_IDENTITY_PublicKey *pubkey; |
diff --git a/src/gnunet_chat_context.c b/src/gnunet_chat_context.c index 929e6ac..d023f10 100644 --- a/src/gnunet_chat_context.c +++ b/src/gnunet_chat_context.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2021 GNUnet e.V. | 3 | Copyright (C) 2021--2022 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
@@ -151,7 +151,7 @@ context_update_nick (struct GNUNET_CHAT_Context *context, | |||
151 | 151 | ||
152 | util_set_name_field(nick, &(context->nick)); | 152 | util_set_name_field(nick, &(context->nick)); |
153 | 153 | ||
154 | if (!context->handle) | 154 | if (!(context->handle)) |
155 | return; | 155 | return; |
156 | 156 | ||
157 | handle_send_internal_message( | 157 | handle_send_internal_message( |
diff --git a/src/gnunet_chat_handle.c b/src/gnunet_chat_handle.c index 1456acb..ff7e210 100644 --- a/src/gnunet_chat_handle.c +++ b/src/gnunet_chat_handle.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2021 GNUnet e.V. | 3 | Copyright (C) 2021--2022 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
@@ -104,7 +104,7 @@ handle_update_key (struct GNUNET_CHAT_Handle *handle) | |||
104 | 104 | ||
105 | handle->public_key = NULL; | 105 | handle->public_key = NULL; |
106 | 106 | ||
107 | if (!handle->messenger) | 107 | if (!(handle->messenger)) |
108 | return; | 108 | return; |
109 | 109 | ||
110 | const struct GNUNET_IDENTITY_PublicKey *pubkey; | 110 | const struct GNUNET_IDENTITY_PublicKey *pubkey; |
@@ -173,7 +173,7 @@ handle_send_internal_message (struct GNUNET_CHAT_Handle *handle, | |||
173 | { | 173 | { |
174 | GNUNET_assert((handle) && (GNUNET_CHAT_FLAG_NONE != flag)); | 174 | GNUNET_assert((handle) && (GNUNET_CHAT_FLAG_NONE != flag)); |
175 | 175 | ||
176 | if (!handle->msg_cb) | 176 | if (!(handle->msg_cb)) |
177 | return; | 177 | return; |
178 | 178 | ||
179 | struct GNUNET_CHAT_Message *msg = message_create_internally( | 179 | struct GNUNET_CHAT_Message *msg = message_create_internally( |
diff --git a/src/gnunet_chat_lib.c b/src/gnunet_chat_lib.c index d5d516d..f7a2075 100644 --- 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) | |||
565 | if ((!context) || (GNUNET_CHAT_CONTEXT_TYPE_GROUP != context->type)) | 565 | if ((!context) || (GNUNET_CHAT_CONTEXT_TYPE_GROUP != context->type)) |
566 | return NULL; | 566 | return NULL; |
567 | 567 | ||
568 | if (!context->room) | 568 | if (!(context->room)) |
569 | return NULL; | 569 | return NULL; |
570 | 570 | ||
571 | return handle_get_group_from_messenger(context->handle, context->room); | 571 | return handle_get_group_from_messenger(context->handle, context->room); |
@@ -830,7 +830,7 @@ struct GNUNET_CHAT_Contact* | |||
830 | GNUNET_CHAT_message_get_sender (const struct GNUNET_CHAT_Message *message) | 830 | GNUNET_CHAT_message_get_sender (const struct GNUNET_CHAT_Message *message) |
831 | { | 831 | { |
832 | if ((!message) || (GNUNET_CHAT_FLAG_NONE != message->flag) || | 832 | if ((!message) || (GNUNET_CHAT_FLAG_NONE != message->flag) || |
833 | (!message->context) || (!message->context->room)) | 833 | (!(message->context)) || (!(message->context->room))) |
834 | return NULL; | 834 | return NULL; |
835 | 835 | ||
836 | const struct GNUNET_MESSENGER_Contact *sender = GNUNET_MESSENGER_get_sender( | 836 | const struct GNUNET_MESSENGER_Contact *sender = GNUNET_MESSENGER_get_sender( |