]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
mount: improve code readability
authorKarel Zak <kzak@redhat.com>
Tue, 23 May 2023 08:47:18 +0000 (10:47 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 23 May 2023 08:47:18 +0000 (10:47 +0200)
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 <kzak@redhat.com>
sys-utils/mount.c

index abed9a03abb92dc1f94544808630ce4d390e5b70..cf62e2dd2b5026529a40e2884621cc47a107b424 100644 (file)
@@ -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"));