summaryrefslogtreecommitdiff
path: root/toxcore
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-06-16 19:32:23 -0400
committerirungentoo <irungentoo@gmail.com>2014-06-16 19:32:23 -0400
commit2de0840d8a4947cd6760aec2ced5a4f6388b9e77 (patch)
treeffea78721cff657dde953c6b944d15bef1df83f8 /toxcore
parent6408c406b29d189b507cefaabe0f4a3817f8ba86 (diff)
The comments say this function only returns -1 on error, fixed that.
Diffstat (limited to 'toxcore')
-rw-r--r--toxcore/Messenger.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c
index 3308b1ed..d91c649c 100644
--- a/toxcore/Messenger.c
+++ b/toxcore/Messenger.c
@@ -270,17 +270,17 @@ int32_t m_addfriend_norequest(Messenger *m, const uint8_t *client_id)
270 270
271 /* Resize the friend list if necessary. */ 271 /* Resize the friend list if necessary. */
272 if (realloc_friendlist(m, m->numfriends + 1) != 0) 272 if (realloc_friendlist(m, m->numfriends + 1) != 0)
273 return FAERR_NOMEM; 273 return -1;
274 274
275 if (id_equal(client_id, m->net_crypto->self_public_key)) 275 if (id_equal(client_id, m->net_crypto->self_public_key))
276 return FAERR_OWNKEY; 276 return -1;
277 277
278 memset(&(m->friendlist[m->numfriends]), 0, sizeof(Friend)); 278 memset(&(m->friendlist[m->numfriends]), 0, sizeof(Friend));
279 279
280 int32_t onion_friendnum = onion_addfriend(m->onion_c, client_id); 280 int32_t onion_friendnum = onion_addfriend(m->onion_c, client_id);
281 281
282 if (onion_friendnum == -1) 282 if (onion_friendnum == -1)
283 return FAERR_UNKNOWN; 283 return -1;
284 284
285 uint32_t i; 285 uint32_t i;
286 286