key/key-misc.c: Fix bogus parentheses in macro.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 18 Sep 2019 17:35:34 +0000 (18:35 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 21 Sep 2019 15:58:53 +0000 (16:58 +0100)
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

index 80e9597..c3442f2 100644 (file)
@@ -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)