From ace8c2289ebacf32b0999381f937c0180ae1294e Mon Sep 17 00:00:00 2001 From: Jman012 Date: Tue, 19 Nov 2013 16:45:49 -0800 Subject: Fixed a cuple stylistic bugs. Behaviour should be the same but the code is now proper. Also fixed tox_copy_friendlist. --- toxcore/Messenger.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'toxcore/Messenger.c') diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 725a92e6..73a1471c 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c @@ -2129,12 +2129,12 @@ uint32_t copy_friendlist(Messenger *m, int *out_list, uint32_t list_size) uint32_t ret = 0; for (i = 0; i < m->numfriends; i++) { - if (i >= list_size) { + if (ret >= list_size) { break; /* Abandon ship */ } if (m->friendlist[i].status > 0) { - out_list[i] = i; + out_list[ret] = i; ret++; } } @@ -2210,12 +2210,12 @@ uint32_t copy_chatlist(Messenger *m, int *out_list, uint32_t list_size) uint32_t ret = 0; for (i = 0; i < m->numchats; i++) { - if (i >= list_size) { + if (ret >= list_size) { break; /* Abandon ship */ } if (m->chats[i]) { - out_list[i] = i; + out_list[ret] = i; ret++; } } -- cgit v1.2.3