From 32ac77ea600fa6ae33fea77d2be8fdaec865da7b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 17 Mar 2018 21:21:21 +0300 Subject: warning fix --- protocols/Tox/src/tox_contacts.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'protocols/Tox/src') diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp index a6ed84d4d7..4920e71e44 100644 --- a/protocols/Tox/src/tox_contacts.cpp +++ b/protocols/Tox/src/tox_contacts.cpp @@ -48,14 +48,13 @@ MCONTACT CToxProto::GetContact(const Tox *tox, const int friendNumber) MCONTACT CToxProto::GetContact(const char *pubKey) { - MCONTACT hContact = NULL; for (auto &hContact : AccContacts()) { ptrA contactPubKey(getStringA(hContact, TOX_SETTINGS_ID)); // check only public key part of address if (mir_strncmpi(pubKey, contactPubKey, TOX_PUBLIC_KEY_SIZE) == 0) - break; + return hContact; } - return hContact; + return 0; } ToxHexAddress CToxProto::GetContactPublicKey(const Tox *tox, const int friendNumber) @@ -160,7 +159,7 @@ INT_PTR CToxProto::OnRequestAuth(WPARAM hContact, LPARAM lParam) ToxBinAddress address(ptrA(getStringA(hContact, TOX_SETTINGS_ID))); TOX_ERR_FRIEND_ADD addFriendResult; - int32_t friendNumber = tox_friend_add(m_toxThread->Tox(), address, (uint8_t*)reason, length, &addFriendResult); + /*int32_t friendNumber = */tox_friend_add(m_toxThread->Tox(), address, (uint8_t*)reason, length, &addFriendResult); if (addFriendResult != TOX_ERR_FRIEND_ADD_OK) { debugLogA(__FUNCTION__": failed to request auth(%d)", addFriendResult); return addFriendResult; -- cgit v1.2.3