]> git.notmuchmail.org Git - apitrace/commitdiff
Fix crash when using apitrace trim's -o option.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 5 Apr 2012 17:51:26 +0000 (10:51 -0700)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Thu, 5 Apr 2012 19:01:41 +0000 (20:01 +0100)
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

index 2ea525103991ba574e3f4a59aa38916926ad55e4..206e24e687cc1b8cd60cae8e02f23079badfeb49 100644 (file)
@@ -58,7 +58,7 @@ enum {
 };
 
 const static char *
-shortOptions = "ho";
+shortOptions = "ho:";
 
 const static struct option
 longOptions[] = {