--- file-5.39/src/file.c.orig 2020-06-17 16:13:36.625305367 +0200 +++ file-5.39/src/file.c 2020-06-17 16:15:12.429553163 +0200 @@ -254,6 +254,8 @@ break; case 'e': case OPT_EXCLUDE_QUIET: + if (!optarg) + usage(); for (i = 0; i < __arraycount(nv); i++) if (strcmp(nv[i].name, optarg) == 0) break; @@ -266,7 +268,7 @@ break; case 'f': - if(action) + if(action || !optarg) usage(); if (magic == NULL) if ((magic = load(magicfile, flags)) == NULL) @@ -276,6 +278,8 @@ ++didsomefiles; break; case 'F': + if(!optarg) + usage(); separator = optarg; break; case 'i': @@ -288,6 +292,8 @@ action = FILE_LIST; break; case 'm': + if(!optarg) + usage(); magicfile = optarg; break; case 'n':