From b119a5eb97e0a36b825d616aaaaae53689ccbe6c Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Wed, 18 Sep 2019 18:35:34 +0100 Subject: [PATCH] key/key-misc.c: Fix bogus parentheses in macro. Organization: Straylight/Edgeware From: Mark Wooding The old, bogus behaviour was that it would report `KERR_READONLY' if the keyring was neither open for writing, /nor/ modified. I think this is relatively benign, but still well deserving of fixing. Spotted by Clang. (cherry picked from commit 924c7057076a23e322d40693912633dc546867e9) --- key/key-misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/key/key-misc.c b/key/key-misc.c index 80e9597d..c3442f28 100644 --- a/key/key-misc.c +++ b/key/key-misc.c @@ -42,7 +42,7 @@ /*----- Useful macros -----------------------------------------------------*/ #define KEY_WRITE(f) do { \ - if (!(f)->f & KF_WRITE) \ + if (!((f)->f & KF_WRITE)) \ return (KERR_READONLY); \ } while (0) -- [mdw]