From 733228fbcf5aa813d74f14ed4d488f11330d2827 Mon Sep 17 00:00:00 2001 From: Petri Latvala Date: Wed, 16 Jan 2019 13:20:45 +0200 Subject: lib/igt_core: Assert that optarg is present If getopt_long is told an argument is required, it will give it. Signed-off-by: Petri Latvala Cc: Arkadiusz Hiler Reviewed-by: Arkadiusz Hiler --- lib/igt_core.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/igt_core.c') 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; -- cgit v1.2.3