summaryrefslogtreecommitdiff
path: root/toxcore/Messenger.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r--toxcore/Messenger.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c
index 14f01373..725a92e6 100644
--- a/toxcore/Messenger.c
+++ b/toxcore/Messenger.c
@@ -2184,7 +2184,9 @@ uint32_t count_chatlist(Messenger *m)
2184 uint32_t i; 2184 uint32_t i;
2185 2185
2186 for (i = 0; i < m->numchats; i++) { 2186 for (i = 0; i < m->numchats; i++) {
2187 ret++; 2187 if (m->chats[i]) {
2188 ret++;
2189 }
2188 } 2190 }
2189 2191
2190 return ret; 2192 return ret;
@@ -2212,8 +2214,10 @@ uint32_t copy_chatlist(Messenger *m, int *out_list, uint32_t list_size)
2212 break; /* Abandon ship */ 2214 break; /* Abandon ship */
2213 } 2215 }
2214 2216
2215 out_list[i] = i; 2217 if (m->chats[i]) {
2216 ret++; 2218 out_list[i] = i;
2219 ret++;
2220 }
2217 } 2221 }
2218 2222
2219 return ret; 2223 return ret;