diff options
Diffstat (limited to 'protocols/Tox/src/tox_profile.cpp')
-rw-r--r-- | protocols/Tox/src/tox_profile.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/protocols/Tox/src/tox_profile.cpp b/protocols/Tox/src/tox_profile.cpp index d103736466..68539952b4 100644 --- a/protocols/Tox/src/tox_profile.cpp +++ b/protocols/Tox/src/tox_profile.cpp @@ -42,6 +42,12 @@ bool CToxProto::LoadToxProfile(Tox_Options *options) fclose(profile);
return false;
}
+
+ if (size == 0)
+ {
+ fclose(profile);
+ return true;
+ }
uint8_t *data = (uint8_t*)mir_calloc(size);
if (fread((char*)data, sizeof(char), size, profile) != (size_t)size)
|