summaryrefslogtreecommitdiff
path: root/toxcore/Messenger.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r--toxcore/Messenger.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c
index 3cb0fbb6..bc7d055b 100644
--- a/toxcore/Messenger.c
+++ b/toxcore/Messenger.c
@@ -2258,10 +2258,14 @@ static int m_handle_packet(void *object, int i, const uint8_t *temp, uint16_t le
2258 2258
2259 uint8_t filenumber = data[0]; 2259 uint8_t filenumber = data[0];
2260 2260
2261#if UINT8_MAX >= MAX_CONCURRENT_FILE_PIPES
2262
2261 if (filenumber >= MAX_CONCURRENT_FILE_PIPES) { 2263 if (filenumber >= MAX_CONCURRENT_FILE_PIPES) {
2262 break; 2264 break;
2263 } 2265 }
2264 2266
2267#endif
2268
2265 uint64_t filesize; 2269 uint64_t filesize;
2266 uint32_t file_type; 2270 uint32_t file_type;
2267 uint16_t filename_length = data_length - head_length; 2271 uint16_t filename_length = data_length - head_length;
@@ -2318,10 +2322,14 @@ static int m_handle_packet(void *object, int i, const uint8_t *temp, uint16_t le
2318 uint8_t filenumber = data[1]; 2322 uint8_t filenumber = data[1];
2319 uint8_t control_type = data[2]; 2323 uint8_t control_type = data[2];
2320 2324
2325#if UINT8_MAX >= MAX_CONCURRENT_FILE_PIPES
2326
2321 if (filenumber >= MAX_CONCURRENT_FILE_PIPES) { 2327 if (filenumber >= MAX_CONCURRENT_FILE_PIPES) {
2322 break; 2328 break;
2323 } 2329 }
2324 2330
2331#endif
2332
2325 if (handle_filecontrol(m, i, send_receive, filenumber, control_type, data + 3, data_length - 3, userdata) == -1) { 2333 if (handle_filecontrol(m, i, send_receive, filenumber, control_type, data + 3, data_length - 3, userdata) == -1) {
2326 // TODO(iphydf): Do something different here? Right now, this 2334 // TODO(iphydf): Do something different here? Right now, this
2327 // check is pointless. 2335 // check is pointless.
@@ -2338,10 +2346,14 @@ static int m_handle_packet(void *object, int i, const uint8_t *temp, uint16_t le
2338 2346
2339 uint8_t filenumber = data[0]; 2347 uint8_t filenumber = data[0];
2340 2348
2349#if UINT8_MAX >= MAX_CONCURRENT_FILE_PIPES
2350
2341 if (filenumber >= MAX_CONCURRENT_FILE_PIPES) { 2351 if (filenumber >= MAX_CONCURRENT_FILE_PIPES) {
2342 break; 2352 break;
2343 } 2353 }
2344 2354
2355#endif
2356
2345 struct File_Transfers *ft = &m->friendlist[i].file_receiving[filenumber]; 2357 struct File_Transfers *ft = &m->friendlist[i].file_receiving[filenumber];
2346 2358
2347 if (ft->status != FILESTATUS_TRANSFERRING) { 2359 if (ft->status != FILESTATUS_TRANSFERRING) {