diff options
author | Jman012 <jman012guy@gmail.com> | 2013-11-19 16:45:49 -0800 |
---|---|---|
committer | Jman012 <jman012guy@gmail.com> | 2013-11-19 16:45:49 -0800 |
commit | ace8c2289ebacf32b0999381f937c0180ae1294e (patch) | |
tree | b40d2b7045240737e4dde16b3277e9b6699c5b84 /toxcore/Messenger.c | |
parent | 478d799ee35ae285eda22a11d4545d1ece39e3bb (diff) |
Fixed a cuple stylistic bugs. Behaviour should be the same but the code is now proper. Also fixed tox_copy_friendlist.
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r-- | toxcore/Messenger.c | 8 |
1 files changed, 4 insertions, 4 deletions
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) | |||
2129 | uint32_t ret = 0; | 2129 | uint32_t ret = 0; |
2130 | 2130 | ||
2131 | for (i = 0; i < m->numfriends; i++) { | 2131 | for (i = 0; i < m->numfriends; i++) { |
2132 | if (i >= list_size) { | 2132 | if (ret >= list_size) { |
2133 | break; /* Abandon ship */ | 2133 | break; /* Abandon ship */ |
2134 | } | 2134 | } |
2135 | 2135 | ||
2136 | if (m->friendlist[i].status > 0) { | 2136 | if (m->friendlist[i].status > 0) { |
2137 | out_list[i] = i; | 2137 | out_list[ret] = i; |
2138 | ret++; | 2138 | ret++; |
2139 | } | 2139 | } |
2140 | } | 2140 | } |
@@ -2210,12 +2210,12 @@ uint32_t copy_chatlist(Messenger *m, int *out_list, uint32_t list_size) | |||
2210 | uint32_t ret = 0; | 2210 | uint32_t ret = 0; |
2211 | 2211 | ||
2212 | for (i = 0; i < m->numchats; i++) { | 2212 | for (i = 0; i < m->numchats; i++) { |
2213 | if (i >= list_size) { | 2213 | if (ret >= list_size) { |
2214 | break; /* Abandon ship */ | 2214 | break; /* Abandon ship */ |
2215 | } | 2215 | } |
2216 | 2216 | ||
2217 | if (m->chats[i]) { | 2217 | if (m->chats[i]) { |
2218 | out_list[i] = i; | 2218 | out_list[ret] = i; |
2219 | ret++; | 2219 | ret++; |
2220 | } | 2220 | } |
2221 | } | 2221 | } |