diff --git a/src/chat/misc.c b/src/chat/misc.c index 784c359..97c60e5 100644 --- a/src/chat/misc.c +++ b/src/chat/misc.c @@ -552,6 +552,9 @@ void *why2_communicate_thread(void *arg) char *why2_read_socket(int socket) { char *raw_socket = read_socket_raw(socket); + + if (raw_socket == NULL) return NULL; + char *final_message; struct json_object *json_obj = json_tokener_parse(raw_socket); @@ -643,6 +646,8 @@ void *why2_listen_server(void *socket) { read = why2_read_socket(*((int*) socket)); + if (read == NULL) continue; + if (strncmp(read, WHY2_CHAT_SERVER_USERNAME ": code", 12) == 0) //CODE WAS SENT { if (strcmp(read + 8, WHY2_CHAT_CODE_SSQC) == 0)