diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index a3295170..954b31dd 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c @@ -1314,17 +1314,17 @@ int file_data(Messenger *m, int friendnumber, uint8_t filenumber, uint8_t *data, uint64_t file_dataremaining(Messenger *m, int friendnumber, uint8_t filenumber, uint8_t send_receive) { if (friend_not_valid(m, friendnumber)) - return -1; + return 0; if (send_receive == 0) { if (m->friendlist[friendnumber].file_sending[filenumber].status == FILESTATUS_NONE) - return -1; + return 0; return m->friendlist[friendnumber].file_sending[filenumber].size - m->friendlist[friendnumber].file_sending[filenumber].transferred; } else { if (m->friendlist[friendnumber].file_receiving[filenumber].status == FILESTATUS_NONE) - return -1; + return 0; return m->friendlist[friendnumber].file_receiving[filenumber].size - m->friendlist[friendnumber].file_receiving[filenumber].transferred; diff --git a/toxcore/tox.c b/toxcore/tox.c index 02137b3c..f4e65ec8 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c @@ -620,7 +620,7 @@ int tox_filedata_size(Tox *tox, int friendnumber) * send_receive is 0 if we want the sending files, 1 if we want the receiving. * * return number of bytes remaining to be sent/received on success - * return -1 on failure + * return 0 on failure */ uint64_t tox_file_dataremaining(Tox *tox, int friendnumber, uint8_t filenumber, uint8_t send_receive) { diff --git a/toxcore/tox.h b/toxcore/tox.h index 735d991a..ea373488 100644 --- a/toxcore/tox.h +++ b/toxcore/tox.h @@ -544,7 +544,7 @@ int tox_filedata_size(Tox *tox, int friendnumber); * send_receive is 0 if we want the sending files, 1 if we want the receiving. * * return number of bytes remaining to be sent/received on success - * return -1 on failure + * return 0 on failure */ uint64_t tox_file_dataremaining(Tox *tox, int friendnumber, uint8_t filenumber, uint8_t send_receive);