43 lines
937 B
Plaintext
43 lines
937 B
Plaintext
---
|
|
src/file.c | 8 +++++++-
|
|
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
|
|
--- src/file.c
|
|
+++ src/file.c 2018-06-12 14:16:45.847489541 +0000
|
|
@@ -244,6 +244,8 @@ main(int argc, char *argv[])
|
|
flags |= MAGIC_ERROR;
|
|
break;
|
|
case 'e':
|
|
+ if (!optarg)
|
|
+ usage();
|
|
for (i = 0; i < sizeof(nv) / sizeof(nv[0]); i++)
|
|
if (strcmp(nv[i].name, optarg) == 0)
|
|
break;
|
|
@@ -255,7 +257,7 @@ main(int argc, char *argv[])
|
|
break;
|
|
|
|
case 'f':
|
|
- if(action)
|
|
+ if(action || !optarg)
|
|
usage();
|
|
if (magic == NULL)
|
|
if ((magic = load(magicfile, flags)) == NULL)
|
|
@@ -265,6 +267,8 @@ main(int argc, char *argv[])
|
|
++didsomefiles;
|
|
break;
|
|
case 'F':
|
|
+ if (!optarg)
|
|
+ usage();
|
|
separator = optarg;
|
|
break;
|
|
case 'i':
|
|
@@ -277,6 +281,8 @@ main(int argc, char *argv[])
|
|
action = FILE_LIST;
|
|
break;
|
|
case 'm':
|
|
+ if (!optarg)
|
|
+ usage();
|
|
magicfile = optarg;
|
|
break;
|
|
case 'n':
|