Re: [hackers] [farbfeld] Minor style change in arg.h || Laslo Hunhold

From: isabella parakiss <izaberina_AT_gmail.com>
Date: Wed, 2 Aug 2017 12:09:42 +0200

On 8/2/17, git_AT_suckless.org <git_AT_suckless.org> wrote:
> commit 37e44c95655e252aa7763671f53524dceaf8a65b
> Author: Laslo Hunhold <dev_AT_frign.de>
> AuthorDate: Wed Aug 2 08:36:28 2017 +0200
> Commit: Laslo Hunhold <dev_AT_frign.de>
> CommitDate: Wed Aug 2 08:36:28 2017 +0200
>
> Minor style change in arg.h
>
> We decrement argc first before incrementing argv, so we never have a
> state where we potentially point to uncharted territory.
>
> diff --git a/arg.h b/arg.h
> index 77cf5be..003f8ec 100644
> --- a/arg.h
> +++ b/arg.h
> _AT_@ -22,7 +22,7 @@
> extern char *argv0;
>
> /* int main(int argc, char *argv[]) */
> -#define ARGBEGIN for (argv0 = *argv, argv++, argc--;
> \
> +#define ARGBEGIN for (argv0 = *argv, argc--, argv++;
> \
> *argv && (*argv)[0] == '-' && (*argv)[1]; argc--,
> argv++) { \
> int argparsed;
> \
> if ((*argv)[1] == '-' && (*argv)[2] == '\0') {
> \
>
>


execve("/my/fine/program", NULL, NULL);

char *empty[] = { NULL };
execve("/my/fine/program", empty, empty);
Received on Wed Aug 02 2017 - 12:09:42 CEST

This archive was generated by hypermail 2.3.0 : Wed Aug 02 2017 - 12:13:12 CEST