Re: [PATCH 3/3] compositor: dump command line options

2012-03-20 Thread Tiago Vignatti
On 03/20/2012 05:06 AM, Pekka Paalanen wrote: On Tue, 20 Mar 2012 00:57:49 -0300 Tiago Vignatti wrote: + if (help) { + dump_options(core_options, ARRAY_LENGTH(core_options)); + argv[argc] = strdup("--help"); + argc++; How do you know there is s

Re: [PATCH 3/3] compositor: dump command line options

2012-03-20 Thread Pekka Paalanen
On Tue, 20 Mar 2012 00:57:49 -0300 Tiago Vignatti wrote: > >> + if (help) { > >> + dump_options(core_options, ARRAY_LENGTH(core_options)); > >> + argv[argc] = strdup("--help"); > >> + argc++; > > > > How do you know there is space in argv[] to add that? > > Also, doesn

Re: [PATCH 3/3] compositor: dump command line options

2012-03-19 Thread Bill Spitzak
On 03/19/2012 08:57 PM, Tiago Vignatti wrote: + argv[argc] = argv[argc - 1] + strlen(argv[argc - 1]) +1; + strcpy(argv[argc], "--help"); You want just: argv[argc] = "--help"; You do not need to copy any string anywhere, and certainly the above is not in any way guaranteed to give you some

Re: [PATCH 3/3] compositor: dump command line options

2012-03-19 Thread Tiago Vignatti
On 03/19/2012 09:08 AM, Pekka Paalanen wrote: On Mon, 12 Mar 2012 19:06:40 -0300 Tiago Vignatti wrote: Use it with --help or -h. Signed-off-by: Tiago Vignatti --- shared/config-parser.h |3 +++ shared/option-parser.c | 13 + src/compositor-drm.c |7 ++-

Re: [PATCH 3/3] compositor: dump command line options

2012-03-19 Thread Bill Spitzak
On 03/19/2012 05:08 AM, Pekka Paalanen wrote: + if (help) { + dump_options(core_options, ARRAY_LENGTH(core_options)); + argv[argc] = strdup("--help"); + argc++; How do you know there is space in argv[] to add that? Also, doesn't strdup() leak her

Re: [PATCH 3/3] compositor: dump command line options

2012-03-19 Thread Pekka Paalanen
On Mon, 12 Mar 2012 19:06:40 -0300 Tiago Vignatti wrote: > Use it with --help or -h. > > Signed-off-by: Tiago Vignatti > --- > shared/config-parser.h |3 +++ > shared/option-parser.c | 13 + > src/compositor-drm.c |7 ++- > src/compositor-openwfd.c |7

[PATCH 3/3] compositor: dump command line options

2012-03-12 Thread Tiago Vignatti
Use it with --help or -h. Signed-off-by: Tiago Vignatti --- shared/config-parser.h |3 +++ shared/option-parser.c | 13 + src/compositor-drm.c |7 ++- src/compositor-openwfd.c |7 ++- src/compositor-wayland.c |8 +++- src/compositor-x11.c |