fix start_crypto handler; need to check ret == 0

This commit is contained in:
Levi Neely 2024-08-14 22:39:32 +02:00
parent 0c3064ce3c
commit 202de9688a
1 changed files with 5 additions and 1 deletions

View File

@ -62,7 +62,11 @@ int start_crypto(const char *pass) {
size_t errm_size;
int result = SendCall(STARTCRYPTO, pass, &ret, &errm, &errm_size);
if (result != 0) {
// in this case, it is not enough to check for result; the server
// should return (ret==0) indicating that the crypto folder was unlocked
// successfully.
if (result != 0 || ret != 0) {
std::cout << "Start Crypto failed. return is " << ret << " and message is "
<< (errm ? errm : "no message") << std::endl;
} else {