From 05b7974f9c3c5222a6ebc01ec4895081ef6459e2 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 27 Sep 2014 18:39:23 +0000 Subject: temp fix for creating profile git-svn-id: http://svn.miranda-ng.org/main/trunk@10615 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_utils.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'protocols/Tox/src/tox_utils.cpp') diff --git a/protocols/Tox/src/tox_utils.cpp b/protocols/Tox/src/tox_utils.cpp index d294be81cd..854d59f40d 100644 --- a/protocols/Tox/src/tox_utils.cpp +++ b/protocols/Tox/src/tox_utils.cpp @@ -176,9 +176,13 @@ void CToxProto::SaveToxData() return; } - uint32_t size = tox_encrypted_size(tox); - uint8_t *data = (uint8_t*)mir_alloc(size); ptrT password(getTStringA("Password")); + uint32_t size; + if (password && _tcslen(password)) + size = tox_encrypted_size(tox); + else + size = tox_size(tox); + uint8_t *data = (uint8_t*)mir_alloc(size); if (password && _tcslen(password)) { char *password_utf8 = mir_utf8encodeW(password); -- cgit v1.2.3