From a5eba5046da6893e360b2e3e1193d1583d25e12c Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 23 May 2023 10:47:18 +0200 Subject: [PATCH] mount: improve code readability Static analyzers (e.g., Coverity) have a hard time understanding why 'optarg' is tested for NULL, and later in another place, code assumes that it's non-NULL. For idmapping, the optarg is required. Signed-off-by: Karel Zak --- sys-utils/mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys-utils/mount.c b/sys-utils/mount.c index abed9a03a..cf62e2dd2 100644 --- a/sys-utils/mount.c +++ b/sys-utils/mount.c @@ -863,7 +863,7 @@ int main(int argc, char **argv) break; case MOUNT_OPT_MAP_GROUPS: case MOUNT_OPT_MAP_USERS: - if (optarg && *optarg == '=') + if (*optarg == '=') optarg++; if (idmap && (*idmap == '/' || *optarg == '/')) { warnx(_("bad usage"));