diff options
author | irungentoo <irungentoo@gmail.com> | 2014-07-05 12:46:58 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2014-07-05 12:46:58 -0400 |
commit | bdb00322e3ecb9eb213ce01688089cdad39304f0 (patch) | |
tree | e800af7543d3b22e26d77e61eb61d018a76273a9 | |
parent | a51f6bbd694e016cb89739da3201d5ad399f306c (diff) |
Fixed bug when loading friends list already containing an added friend.
-rw-r--r-- | toxcore/Messenger.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 4344fdcb..2adbd870 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c | |||
@@ -2598,6 +2598,10 @@ static int friends_list_load(Messenger *m, const uint8_t *data, uint32_t length) | |||
2598 | 2598 | ||
2599 | if (temp.status >= 3) { | 2599 | if (temp.status >= 3) { |
2600 | int fnum = m_addfriend_norequest(m, temp.client_id); | 2600 | int fnum = m_addfriend_norequest(m, temp.client_id); |
2601 | |||
2602 | if (fnum < 0) | ||
2603 | continue; | ||
2604 | |||
2601 | setfriendname(m, fnum, temp.name, ntohs(temp.name_length)); | 2605 | setfriendname(m, fnum, temp.name, ntohs(temp.name_length)); |
2602 | set_friend_statusmessage(m, fnum, temp.statusmessage, ntohs(temp.statusmessage_length)); | 2606 | set_friend_statusmessage(m, fnum, temp.statusmessage, ntohs(temp.statusmessage_length)); |
2603 | set_friend_userstatus(m, fnum, temp.userstatus); | 2607 | set_friend_userstatus(m, fnum, temp.userstatus); |