summaryrefslogtreecommitdiff
path: root/testing/tox_sync.c
diff options
context:
space:
mode:
Diffstat (limited to 'testing/tox_sync.c')
-rw-r--r--testing/tox_sync.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/testing/tox_sync.c b/testing/tox_sync.c
index c719b3ec..d2fc41ca 100644
--- a/testing/tox_sync.c
+++ b/testing/tox_sync.c
@@ -34,6 +34,7 @@
34#include "config.h" 34#include "config.h"
35#endif 35#endif
36 36
37#include "../toxcore/ccompat.h"
37#include "../toxcore/tox.h" 38#include "../toxcore/tox.h"
38#include "misc_tools.c" 39#include "misc_tools.c"
39 40
@@ -73,7 +74,7 @@ static void tox_file_chunk_request(Tox *tox, uint32_t friend_number, uint32_t fi
73 } 74 }
74 75
75 fseek(file_senders[i].file, position, SEEK_SET); 76 fseek(file_senders[i].file, position, SEEK_SET);
76 uint8_t data[length]; 77 VLA(uint8_t, data, length);
77 int len = fread(data, 1, length, file_senders[i].file); 78 int len = fread(data, 1, length, file_senders[i].file);
78 tox_file_send_chunk(tox, friend_number, file_number, position, data, len, 0); 79 tox_file_send_chunk(tox, friend_number, file_number, position, data, len, 0);
79 break; 80 break;
@@ -314,7 +315,7 @@ int main(int argc, char *argv[])
314 315
315 if (d) { 316 if (d) {
316 while ((dir = readdir(d)) != NULL) { 317 while ((dir = readdir(d)) != NULL) {
317 char filepath[strlen(path) + strlen(dir->d_name) + 1]; 318 VLA(char, filepath, strlen(path) + strlen(dir->d_name) + 1);
318 memcpy(filepath, path, strlen(path)); 319 memcpy(filepath, path, strlen(path));
319 memcpy(filepath + strlen(path), dir->d_name, strlen(dir->d_name) + 1); 320 memcpy(filepath + strlen(path), dir->d_name, strlen(dir->d_name) + 1);
320 stat(filepath, &statbuf); 321 stat(filepath, &statbuf);