diff options
author | Lucas Gabriel Vuotto <l.vuotto92@gmail.com> | 2016-02-19 15:59:49 -0300 |
---|---|---|
committer | Christoph Lohmann <20h@r-36.net> | 2016-02-21 17:21:41 +0100 |
commit | 4fdba860c8db70035e9749806ecc6ca2d7c418d0 (patch) | |
tree | 4a1044d94fd378bedc1d338c8f9f1d89183e7573 | |
parent | 6d636beb229cebf3b897446c72c7a341bee9f820 (diff) |
arg.h: fixed argv checks order
This prevents accessing to a potentially out-of-bounds memory section.
Signed-off-by: Lucas Gabriel Vuotto <l.vuotto92@gmail.com>
Signed-off-by: Christoph Lohmann <20h@r-36.net>
-rw-r--r-- | arg.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -10,8 +10,8 @@ extern char *argv0; /* use main(int argc, char *argv[]) */ #define ARGBEGIN for (argv0 = *argv, argv++, argc--;\ - argv[0] && argv[0][1]\ - && argv[0][0] == '-';\ + argv[0] && argv[0][0] == '-'\ + && argv[0][1];\ argc--, argv++) {\ char argc_;\ char **argv_;\ |