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
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
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
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 ++-
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
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
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 |