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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/testing/tox_sync.c b/testing/tox_sync.c
index 441fdaa0..3207e297 100644
--- a/testing/tox_sync.c
+++ b/testing/tox_sync.c
@@ -66,7 +66,8 @@ void send_filesenders(Tox *m)
66 file_senders[i].piecelength)) 66 file_senders[i].piecelength))
67 break; 67 break;
68 68
69 file_senders[i].piecelength = fread(file_senders[i].nextpiece, 1, 1000, file_senders[i].file); 69 file_senders[i].piecelength = fread(file_senders[i].nextpiece, 1, tox_filedata_size(m, file_senders[i].friendnum),
70 file_senders[i].file);
70 71
71 if (file_senders[i].piecelength == 0) { 72 if (file_senders[i].piecelength == 0) {
72 fclose(file_senders[i].file); 73 fclose(file_senders[i].file);
@@ -95,7 +96,8 @@ int add_filesender(Tox *m, uint16_t friendnum, char *filename)
95 return -1; 96 return -1;
96 97
97 file_senders[numfilesenders].file = tempfile; 98 file_senders[numfilesenders].file = tempfile;
98 file_senders[numfilesenders].piecelength = fread(file_senders[numfilesenders].nextpiece, 1, 1000, 99 file_senders[numfilesenders].piecelength = fread(file_senders[numfilesenders].nextpiece, 1, tox_filedata_size(m,
100 file_senders[numfilesenders].friendnum),
99 file_senders[numfilesenders].file); 101 file_senders[numfilesenders].file);
100 file_senders[numfilesenders].friendnum = friendnum; 102 file_senders[numfilesenders].friendnum = friendnum;
101 file_senders[numfilesenders].filenumber = filenum; 103 file_senders[numfilesenders].filenumber = filenum;