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:
parent
e03d80392a
commit
fff2caa0e1
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue
Block a user