summaryrefslogtreecommitdiff
path: root/protocols/Tox
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-03-03 18:55:10 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-03-03 18:55:10 +0000
commit797fa5a1ffc347d8e18a8194d2ed5d26b5ff769f (patch)
treeecc1cbd41bf8051a10d65a293c0ed6437b2c41ca /protocols/Tox
parent0b00197b7968a760c4dc9d026fb80b74331e4856 (diff)
Tox: fixed crash on options saving
git-svn-id: http://svn.miranda-ng.org/main/trunk@12308 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox')
-rw-r--r--protocols/Tox/src/tox_search.cpp2
-rw-r--r--protocols/Tox/src/tox_services.cpp5
2 files changed, 5 insertions, 2 deletions
diff --git a/protocols/Tox/src/tox_search.cpp b/protocols/Tox/src/tox_search.cpp
index 8ec4a35250..910b5497a9 100644
--- a/protocols/Tox/src/tox_search.cpp
+++ b/protocols/Tox/src/tox_search.cpp
@@ -12,7 +12,7 @@ ToxHexAddress ResolveToxAddressFromDnsRecordV1(const std::string &dnsRecord)
return ToxHexAddress::Empty();
}
-ToxHexAddress ResolveToxAddressFromDnsRecordV2(const std::string &dnsRecord)
+ToxHexAddress ResolveToxAddressFromDnsRecordV2(const std::string &/*dnsRecord*/)
{
// unsupported
/*std::smatch match;
diff --git a/protocols/Tox/src/tox_services.cpp b/protocols/Tox/src/tox_services.cpp
index f970e5499a..136c7baa5b 100644
--- a/protocols/Tox/src/tox_services.cpp
+++ b/protocols/Tox/src/tox_services.cpp
@@ -5,6 +5,9 @@ INT_PTR __cdecl CToxProto::SetMyNickname(WPARAM wParam, LPARAM lParam)
ptrT nickname((wParam & SMNN_UNICODE) ? mir_u2t((TCHAR*)lParam) : mir_a2t((char*)lParam));
setTString("Nick", nickname);
- tox_set_name(tox, (uint8_t*)(char*)ptrA(mir_utf8encodeT(nickname)), mir_tstrlen(nickname));
+ if (IsToxCoreInited())
+ {
+ tox_set_name(tox, (uint8_t*)(char*)ptrA(mir_utf8encodeT(nickname)), mir_tstrlen(nickname));
+ }
return 0;
}