1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Fix Core::getSaltFromFile's error checking

tox_get_salt now returns a bool, not an int. So any error condition has to be inveted to check for 0 instead of -1.
This commit is contained in:
tux3 2015-04-24 01:08:34 +02:00
parent e03d80392a
commit fff2caa0e1
No known key found for this signature in database
GPG Key ID: 7E086DD661263264

View File

@ -154,8 +154,7 @@ QByteArray Core::getSaltFromFile(QString filename)
file.close();
uint8_t *salt = new uint8_t[TOX_PASS_SALT_LENGTH];
int err = tox_get_salt(reinterpret_cast<uint8_t *>(data.data()), salt);
if (err)
if (!tox_get_salt(reinterpret_cast<uint8_t *>(data.data()), salt))
{
qWarning() << "Core: can't get salt from" << filename << "header";
return QByteArray();