From 46951dcc9a23aea93e5a78e87c4cc76dfafad569 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Tue, 3 Mar 2026 11:23:46 +0100 Subject: [PATCH] Fix exception handling and operator precedence bugs - Add return statement in catch(...) block to prevent fallthrough - Fix operator precedence in GetState() to capture Call() return value Fixes #201, #202 --- 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);