From: Alejandro Colomar Date: Sat, 2 Sep 2023 14:19:58 +0000 (+0200) Subject: src/gpasswd.c: Simplify cpp conditional X-Git-Tag: 4.15.0-rc1~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62772039b739c06395dabcaa83c37d7d6d3a0e0d;p=thirdparty%2Fshadow.git 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 --- diff --git a/src/gpasswd.c b/src/gpasswd.c index bab9bf193..3936b85e6 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 } }