[Cryptech-Commits] [sw/libhal] branch master updated: Don't reuse local variable in check() macro.

git at cryptech.is git at cryptech.is
Fri Jul 8 04:29:41 UTC 2016


This is an automated email from the git hooks/post-receive script.

paul at psgd.org pushed a commit to branch master
in repository sw/libhal.

The following commit(s) were added to refs/heads/master by this push:
       new  5780334   Don't reuse local variable in check() macro.
5780334 is described below

commit 5780334a373ce55eb9ce977df185234844ac1924
Author: Paul Selkirk <paul at psgd.org>
AuthorDate: Fri Jul 8 00:29:04 2016 -0400

    Don't reuse local variable in check() macro.
---
 rpc_server.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/rpc_server.c b/rpc_server.c
index 7f6a5f6..a0de42d 100644
--- a/rpc_server.c
+++ b/rpc_server.c
@@ -40,7 +40,7 @@
  * RPC calls.
  */
 
-#define check(op) if ((ret = (op)) != HAL_OK) return ret;
+#define check(op) do { hal_error_t _err = (op); if (_err != HAL_OK) return _err; } while (0)
 
 #define pad(n) (((n) + 3) & ~3)
 
@@ -497,7 +497,6 @@ static hal_error_t pkey_get_public_key_len(const uint8_t **iptr, const uint8_t *
     hal_client_handle_t client __attribute__((unused));
     hal_pkey_handle_t pkey;
     size_t len;
-    hal_error_t ret;
 
     check(hal_xdr_decode_int(iptr, ilimit, &client.handle));
     check(hal_xdr_decode_int(iptr, ilimit, &pkey.handle));

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Commits mailing list