diff options
author | AZ Huang <aitjcize@gmail.com> | 2013-11-29 22:26:29 +0800 |
---|---|---|
committer | AZ Huang <aitjcize@gmail.com> | 2013-11-29 22:26:29 +0800 |
commit | 1df2d5880db375b6a2d5259bb8ff2560c9f1007d (patch) | |
tree | c4f520eb7f5764af6225ae0328f412b7473ee61a /toxcore/Messenger.c | |
parent | eec31edb1c6fe5d0ffdc79f6b38a89f6a4a9b20d (diff) |
Should return 0 for tox_file_dataremaining since it returns unsigned
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r-- | toxcore/Messenger.c | 6 |
1 files changed, 3 insertions, 3 deletions
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, | |||
1314 | uint64_t file_dataremaining(Messenger *m, int friendnumber, uint8_t filenumber, uint8_t send_receive) | 1314 | uint64_t file_dataremaining(Messenger *m, int friendnumber, uint8_t filenumber, uint8_t send_receive) |
1315 | { | 1315 | { |
1316 | if (friend_not_valid(m, friendnumber)) | 1316 | if (friend_not_valid(m, friendnumber)) |
1317 | return -1; | 1317 | return 0; |
1318 | 1318 | ||
1319 | if (send_receive == 0) { | 1319 | if (send_receive == 0) { |
1320 | if (m->friendlist[friendnumber].file_sending[filenumber].status == FILESTATUS_NONE) | 1320 | if (m->friendlist[friendnumber].file_sending[filenumber].status == FILESTATUS_NONE) |
1321 | return -1; | 1321 | return 0; |
1322 | 1322 | ||
1323 | return m->friendlist[friendnumber].file_sending[filenumber].size - | 1323 | return m->friendlist[friendnumber].file_sending[filenumber].size - |
1324 | m->friendlist[friendnumber].file_sending[filenumber].transferred; | 1324 | m->friendlist[friendnumber].file_sending[filenumber].transferred; |
1325 | } else { | 1325 | } else { |
1326 | if (m->friendlist[friendnumber].file_receiving[filenumber].status == FILESTATUS_NONE) | 1326 | if (m->friendlist[friendnumber].file_receiving[filenumber].status == FILESTATUS_NONE) |
1327 | return -1; | 1327 | return 0; |
1328 | 1328 | ||
1329 | return m->friendlist[friendnumber].file_receiving[filenumber].size - | 1329 | return m->friendlist[friendnumber].file_receiving[filenumber].size - |
1330 | m->friendlist[friendnumber].file_receiving[filenumber].transferred; | 1330 | m->friendlist[friendnumber].file_receiving[filenumber].transferred; |