From 175a46a109b64faebc54ba287a9856a6d3c06cc5 Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Tue, 3 Mar 2026 11:25:25 +0100 Subject: [PATCH] Fix exception handling and operator precedence bugs (#295) - Add return statement in catch(...) block to prevent fallthrough - Fix operator precedence in GetState() to capture Call() return value Fixes #201, #202 Co-authored-by: Levi Neely --- main.cpp | 1 + rpcclient.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 722fe66..081ff17 100644 --- a/main.cpp +++ b/main.cpp @@ -214,6 +214,7 @@ int main(int argc, char **argv) { return 1; } catch (...) { std::cerr << "Exception of unknown type!" << std::endl; + return 1; } if (daemon) { diff --git a/rpcclient.cpp b/rpcclient.cpp index fb5d897..c9d89ac 100644 --- a/rpcclient.cpp +++ b/rpcclient.cpp @@ -135,7 +135,7 @@ int RpcClient::GetState(pCloud_FileState *state, char *path) { size_t errm_size = 0; int rep = 0; - if ((rep = this->Call(4, path, &errm, &errm_size) == 0)) { + if ((rep = this->Call(4, path, &errm, &errm_size)) == 0) { pdbg_logf(D_NOTICE, "rpc_get_state responese rep[%d] path[%s]", rep, path); if (errm) { pdbg_logf(D_NOTICE, "The error is %s", errm);