mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
The comments say this function only returns -1 on error, fixed that.
This commit is contained in:
parent
6408c406b2
commit
2de0840d8a
|
@ -270,17 +270,17 @@ int32_t m_addfriend_norequest(Messenger *m, const uint8_t *client_id)
|
||||||
|
|
||||||
/* Resize the friend list if necessary. */
|
/* Resize the friend list if necessary. */
|
||||||
if (realloc_friendlist(m, m->numfriends + 1) != 0)
|
if (realloc_friendlist(m, m->numfriends + 1) != 0)
|
||||||
return FAERR_NOMEM;
|
return -1;
|
||||||
|
|
||||||
if (id_equal(client_id, m->net_crypto->self_public_key))
|
if (id_equal(client_id, m->net_crypto->self_public_key))
|
||||||
return FAERR_OWNKEY;
|
return -1;
|
||||||
|
|
||||||
memset(&(m->friendlist[m->numfriends]), 0, sizeof(Friend));
|
memset(&(m->friendlist[m->numfriends]), 0, sizeof(Friend));
|
||||||
|
|
||||||
int32_t onion_friendnum = onion_addfriend(m->onion_c, client_id);
|
int32_t onion_friendnum = onion_addfriend(m->onion_c, client_id);
|
||||||
|
|
||||||
if (onion_friendnum == -1)
|
if (onion_friendnum == -1)
|
||||||
return FAERR_UNKNOWN;
|
return -1;
|
||||||
|
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user