From fff2caa0e1a905b25fd72a3bed9bb75e336927e7 Mon Sep 17 00:00:00 2001 From: tux3 Date: Fri, 24 Apr 2015 01:08:34 +0200 Subject: [PATCH] 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. --- src/coreencryption.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/coreencryption.cpp b/src/coreencryption.cpp index f6deef235..bd19eab76 100644 --- a/src/coreencryption.cpp +++ b/src/coreencryption.cpp @@ -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(data.data()), salt); - if (err) + if (!tox_get_salt(reinterpret_cast(data.data()), salt)) { qWarning() << "Core: can't get salt from" << filename << "header"; return QByteArray();