[igt-dev] [PATCH i-g-t 16/21] lib/igt_core: Assert that optarg is present
Petri Latvala
petri.latvala at intel.com
Wed Jan 16 11:20:45 UTC 2019
If getopt_long is told an argument is required, it will give it.
Signed-off-by: Petri Latvala <petri.latvala at intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
---
lib/igt_core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/igt_core.c b/lib/igt_core.c
index 7c727edc..26dd2789 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -760,6 +760,7 @@ static int common_init(int *argc, char **argv,
list_subtests = true;
break;
case OPT_RUN_SUBTEST:
+ assert(optarg);
if (!list_subtests)
run_single_subtest = strdup(optarg);
break;
--
2.19.1
More information about the igt-dev
mailing list