summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_profile.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-02-01 09:23:58 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-02-01 09:23:58 +0000
commit09fa77d73829e76123ac7a9b73bc90def12e9d9c (patch)
tree20c5e5a4fc83c672e0505db662e88c16635c5d9d /protocols/Tox/src/tox_profile.cpp
parenta76b0175b2cb203f4a0cc68c99588f23ef945eb6 (diff)
Tox:
- refactoring - updated tox core git-svn-id: http://svn.miranda-ng.org/main/trunk@11970 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_profile.cpp')
-rw-r--r--protocols/Tox/src/tox_profile.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/protocols/Tox/src/tox_profile.cpp b/protocols/Tox/src/tox_profile.cpp
index 898899bff1..d169b21f78 100644
--- a/protocols/Tox/src/tox_profile.cpp
+++ b/protocols/Tox/src/tox_profile.cpp
@@ -31,8 +31,8 @@ bool CToxProto::LoadToxProfile()
}
fseek(profile, 0, SEEK_END);
- size_t size = ftell(profile);
- fseek(profile, 0, SEEK_SET);
+ size_t size = _ftelli64(profile);
+ rewind(profile);
if (size == 0)
{
fclose(profile);
@@ -41,8 +41,7 @@ bool CToxProto::LoadToxProfile()
}
uint8_t *data = (uint8_t*)mir_calloc(size);
- size_t read = fread((char*)data, sizeof(char), size, profile);
- if (size != read)
+ if (fread((char*)data, sizeof(char), size, profile) != size)
{
fclose(profile);
debugLogA("CToxProto::LoadToxData: could not read tox profile");
@@ -66,7 +65,7 @@ bool CToxProto::LoadToxProfile()
}
}
- if (tox_encrypted_load(tox, data, size, (uint8_t*)password, strlen(password)) == TOX_ERROR)
+ if (tox_encrypted_load(tox, data, size, (uint8_t*)password, mir_strlen(password)) == TOX_ERROR)
{
debugLogA("CToxProto::LoadToxData: could not decrypt tox profile");
mir_free(data);