summaryrefslogtreecommitdiff
path: root/testing/irc_syncbot.c
diff options
context:
space:
mode:
Diffstat (limited to 'testing/irc_syncbot.c')
-rw-r--r--testing/irc_syncbot.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/testing/irc_syncbot.c b/testing/irc_syncbot.c
index 783be51a..91267f84 100644
--- a/testing/irc_syncbot.c
+++ b/testing/irc_syncbot.c
@@ -83,6 +83,7 @@ static int reconnect(void)
83 return new_sock; 83 return new_sock;
84} 84}
85 85
86#include "../toxcore/ccompat.h"
86#include "../toxcore/tox.h" 87#include "../toxcore/tox.h"
87#include "misc_tools.c" 88#include "misc_tools.c"
88 89
@@ -178,7 +179,7 @@ static void send_irc_group(Tox *tox, uint8_t *msg, uint16_t len)
178 return; 179 return;
179 } 180 }
180 181
181 uint8_t req[len]; 182 VLA(uint8_t, req, len);
182 unsigned int i; 183 unsigned int i;
183 184
184 unsigned int spaces = 0; 185 unsigned int spaces = 0;
@@ -198,7 +199,7 @@ static void send_irc_group(Tox *tox, uint8_t *msg, uint16_t len)
198 unsigned int req_len = i; 199 unsigned int req_len = i;
199 req[i] = 0; 200 req[i] = 0;
200 201
201 uint8_t message[len]; 202 VLA(uint8_t, message, len);
202 uint16_t length = 0; 203 uint16_t length = 0;
203 204
204 uint8_t *pmsg = (uint8_t *)strstr((char *)req, " PRIVMSG"); 205 uint8_t *pmsg = (uint8_t *)strstr((char *)req, " PRIVMSG");
@@ -298,7 +299,7 @@ int main(int argc, char *argv[])
298 if (count > 0) { 299 if (count > 0) {
299 last_get = get_monotime_sec(); 300 last_get = get_monotime_sec();
300 ping_sent = 0; 301 ping_sent = 0;
301 uint8_t data[count + 1]; 302 VLA(uint8_t, data, count + 1);
302 data[count] = 0; 303 data[count] = 0;
303 recv(sock, data, count, MSG_NOSIGNAL); 304 recv(sock, data, count, MSG_NOSIGNAL);
304 printf("%s", data); 305 printf("%s", data);