[PATCH] Fix crash when using apitrace trim's -o option.

José Fonseca jose.r.fonseca at gmail.com
Thu Apr 5 12:08:05 PDT 2012


Commited. Thanks.

Joe

On Thu, Apr 5, 2012 at 6:51 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> 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 files changed, 1 insertions(+), 1 deletions(-)
>
> 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[] = {
> --
> 1.7.7.6
>
> _______________________________________________
> apitrace mailing list
> apitrace at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/apitrace


More information about the apitrace mailing list