summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2014-08-10 17:13:35 +0000
committerKirill Volinsky <mataes2007@gmail.com>2014-08-10 17:13:35 +0000
commit7e5ea8ede78268b68b86f3f6d279deaf24593fb2 (patch)
treed161f74be8622f9b1716e9e24d8d309fa568a00a /protocols
parent40ca3f169e61d1273d47ddcee277bbc5bcb6ffdf (diff)
fixed read\write tox profile
git-svn-id: http://svn.miranda-ng.org/main/trunk@10146 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Tox/src/tox_account.cpp2
-rw-r--r--protocols/Tox/src/tox_proto.cpp4
-rw-r--r--protocols/Tox/src/tox_utils.cpp6
3 files changed, 6 insertions, 6 deletions
diff --git a/protocols/Tox/src/tox_account.cpp b/protocols/Tox/src/tox_account.cpp
index c63328f6ac..a406d8d55c 100644
--- a/protocols/Tox/src/tox_account.cpp
+++ b/protocols/Tox/src/tox_account.cpp
@@ -54,7 +54,7 @@ void CToxProto::ConnectionThread(void*)
isConnected = true;
char dataPath[MAX_PATH];
- mir_snprintf(dataPath, MAX_PATH, "%s\\%s.tox", VARS("%miranda_profile%\\%miranda_profilename%"), m_tszUserName);
+ mir_snprintf(dataPath, MAX_PATH, "%s\\%s.tox", VARS("%miranda_profile%\\%miranda_profilename%"), _T2A(m_tszUserName));
SaveToxData(dataPath);
diff --git a/protocols/Tox/src/tox_proto.cpp b/protocols/Tox/src/tox_proto.cpp
index 41abbb673a..0af9bd0cc3 100644
--- a/protocols/Tox/src/tox_proto.cpp
+++ b/protocols/Tox/src/tox_proto.cpp
@@ -9,7 +9,7 @@ CToxProto::CToxProto(const char* protoName, const TCHAR* userName) :
get_id(tox, idstring);
char dataPath[MAX_PATH];
- mir_snprintf(dataPath, MAX_PATH, "%s\\%s.tox", VARS("%miranda_profile%\\%miranda_profilename%"), m_tszUserName);
+ mir_snprintf(dataPath, MAX_PATH, "%s\\%s.tox", VARS("%miranda_profile%\\%miranda_profilename%"), _T2A(m_tszUserName));
LoadToxData(dataPath);
@@ -30,7 +30,7 @@ CToxProto::CToxProto(const char* protoName, const TCHAR* userName) :
CToxProto::~CToxProto()
{
char dataPath[MAX_PATH];
- mir_snprintf(dataPath, MAX_PATH, "%s\\%s.tox", VARS("%miranda_profile%\\%miranda_profilename%"), m_tszUserName);
+ mir_snprintf(dataPath, MAX_PATH, "%s\\%s.tox", VARS("%miranda_profile%\\%miranda_profilename%"), _T2A(m_tszUserName));
SaveToxData(dataPath);
diff --git a/protocols/Tox/src/tox_utils.cpp b/protocols/Tox/src/tox_utils.cpp
index d7c1763145..e6f1a037f8 100644
--- a/protocols/Tox/src/tox_utils.cpp
+++ b/protocols/Tox/src/tox_utils.cpp
@@ -66,7 +66,7 @@ char *CToxProto::DataToHexString(const uint8_t *bin_string)
int CToxProto::LoadToxData(const char *path)
{
- FILE *hFile = fopen(path, "r");
+ FILE *hFile = fopen(path, "rb");
if (hFile)
{
@@ -103,7 +103,7 @@ int CToxProto::LoadToxData(const char *path)
int CToxProto::SaveToxData(const char *path)
{
- FILE *hFile = fopen(path, "w");
+ FILE *hFile = fopen(path, "wb");
if (!hFile)
{
@@ -112,7 +112,7 @@ int CToxProto::SaveToxData(const char *path)
}
int res = 1;
- size_t size = tox_size(tox);
+ uint32_t size = tox_size(tox);
uint8_t *data = (uint8_t*)mir_alloc(size);
tox_save(tox, data);