From 5245ded8cba4462a4a7552cb10e1722e80e49d42 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 5 Apr 2012 10:51:26 -0700 Subject: [PATCH] Fix crash when using apitrace trim's -o option. The -o option takes an argument (the filename), so the getopt string needs to be 'o:', not 'o'. Otherwise, no argument is parsed, optarg remains NULL, and we crash on "output = optarg". --- cli/cli_trim.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/cli_trim.cpp b/cli/cli_trim.cpp index 2ea5251..206e24e 100644 --- a/cli/cli_trim.cpp +++ b/cli/cli_trim.cpp @@ -58,7 +58,7 @@ enum { }; const static char * -shortOptions = "ho"; +shortOptions = "ho:"; const static struct option longOptions[] = { -- 2.43.0