2016-06-01 12:23:07 +02:00
|
|
|
---
|
|
|
|
src/file.c | 8 +++++++-
|
|
|
|
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
|
|
|
2013-09-30 16:29:55 +02:00
|
|
|
--- src/file.c
|
2019-05-27 11:37:06 +02:00
|
|
|
+++ src/file.c 2019-05-27 08:48:39.047051545 +0000
|
|
|
|
@@ -242,6 +242,8 @@ main(int argc, char *argv[])
|
2014-02-18 11:22:22 +01:00
|
|
|
flags |= MAGIC_ERROR;
|
2007-05-17 11:31:52 +02:00
|
|
|
break;
|
|
|
|
case 'e':
|
|
|
|
+ if (!optarg)
|
|
|
|
+ usage();
|
2019-05-27 11:37:06 +02:00
|
|
|
for (i = 0; i < __arraycount(nv); i++)
|
2007-05-17 11:31:52 +02:00
|
|
|
if (strcmp(nv[i].name, optarg) == 0)
|
|
|
|
break;
|
2019-05-27 11:37:06 +02:00
|
|
|
@@ -253,7 +255,7 @@ main(int argc, char *argv[])
|
2007-05-17 11:31:52 +02:00
|
|
|
break;
|
2009-05-06 18:38:39 +02:00
|
|
|
|
2007-05-17 11:31:52 +02:00
|
|
|
case 'f':
|
|
|
|
- if(action)
|
|
|
|
+ if(action || !optarg)
|
|
|
|
usage();
|
2009-05-06 18:38:39 +02:00
|
|
|
if (magic == NULL)
|
|
|
|
if ((magic = load(magicfile, flags)) == NULL)
|
2019-05-27 11:37:06 +02:00
|
|
|
@@ -263,6 +265,8 @@ main(int argc, char *argv[])
|
2007-05-17 11:31:52 +02:00
|
|
|
++didsomefiles;
|
|
|
|
break;
|
|
|
|
case 'F':
|
|
|
|
+ if (!optarg)
|
|
|
|
+ usage();
|
|
|
|
separator = optarg;
|
|
|
|
break;
|
|
|
|
case 'i':
|
2019-05-27 11:37:06 +02:00
|
|
|
@@ -275,6 +279,8 @@ main(int argc, char *argv[])
|
2011-06-14 19:53:47 +02:00
|
|
|
action = FILE_LIST;
|
2007-05-17 11:31:52 +02:00
|
|
|
break;
|
|
|
|
case 'm':
|
|
|
|
+ if (!optarg)
|
|
|
|
+ usage();
|
|
|
|
magicfile = optarg;
|
|
|
|
break;
|
|
|
|
case 'n':
|