From 62772039b739c06395dabcaa83c37d7d6d3a0e0d Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sat, 2 Sep 2023 16:19:58 +0200 Subject: [PATCH] src/gpasswd.c: Simplify cpp conditional Since failure() is [[noreturn]], we can invert the conditional so that we don't need an else. This silences a -Wunused-parameter warning. Signed-off-by: Alejandro Colomar --- src/gpasswd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gpasswd.c b/src/gpasswd.c index bab9bf19..3936b85e 100644 --- a/src/gpasswd.c +++ b/src/gpasswd.c @@ -726,15 +726,14 @@ static void check_perms (const struct group *gr) * first group member might be just a normal user. * --marekm */ -#if defined(FIRST_MEMBER_IS_ADMIN) +#if !defined(FIRST_MEMBER_IS_ADMIN) + failure(); +#endif if (gr->gr_mem[0] == NULL) failure(); if (strcmp(gr->gr_mem[0], myname) != 0) failure(); -#else /* ! FIRST_MEMBER_IS_ADMIN */ - failure(); -#endif } }