From 2467e6d592327884d151f5a93c1bd19214744dc5 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Wed, 2 Oct 2013 09:42:28 -0400 Subject: [PATCH 1/2] Fixed bug. --- toxcore/Messenger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 49be4a0a..b31e1c81 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c @@ -1459,7 +1459,7 @@ void doFriends(Messenger *m) //filesize = ntohll(filesize); m->friendlist[i].file_receiving[filenumber].status = 1; m->friendlist[i].file_receiving[filenumber].size = filesize; - + m->friendlist[i].file_receiving[filenumber].transferred = 0; if (m->file_sendrequest) (*m->file_sendrequest)(m, i, filenumber, filesize, data + 1 + sizeof(uint64_t), data_length - 1 - sizeof(uint64_t), m->file_sendrequest_userdata); From 0fb3c9eeede6da300cd4bb94540af09ee9a3327e Mon Sep 17 00:00:00 2001 From: irungentoo Date: Wed, 2 Oct 2013 10:28:08 -0400 Subject: [PATCH 2/2] Max length of filenames is now 255 bytes. --- toxcore/Messenger.c | 6 +++--- toxcore/Messenger.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index b31e1c81..6035fcb7 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c @@ -970,10 +970,10 @@ void callback_file_data(Messenger *m, void (*function)(Messenger *m, int, uint8_ m->file_filedata_userdata = userdata; } -#define MAX_FILENAME_LENGTH 256 +#define MAX_FILENAME_LENGTH 255 /* Send a file send request. - * Maximum filename length is 256 bytes. + * Maximum filename length is 255 bytes. * return 1 on success * return 0 on failure */ @@ -997,7 +997,7 @@ int file_sendrequest(Messenger *m, int friendnumber, uint8_t filenumber, uint64_ } /* Send a file send request. - * Maximum filename length is 256 bytes. + * Maximum filename length is 255 bytes. * return file number on success * return -1 on failure */ diff --git a/toxcore/Messenger.h b/toxcore/Messenger.h index ca99fa18..8e635afe 100644 --- a/toxcore/Messenger.h +++ b/toxcore/Messenger.h @@ -495,7 +495,7 @@ void callback_file_data(Messenger *m, void (*function)(Messenger *m, int, uint8_ void *userdata); /* Send a file send request. - * Maximum filename length is 256 bytes. + * Maximum filename length is 255 bytes. * return 1 on success * return 0 on failure */ @@ -503,7 +503,7 @@ int file_sendrequest(Messenger *m, int friendnumber, uint8_t filenumber, uint64_ uint16_t filename_length); /* Send a file send request. - * Maximum filename length is 256 bytes. + * Maximum filename length is 255 bytes. * return file number on success * return -1 on failure */