aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Gabriel Vuotto <l.vuotto92@gmail.com>2016-02-22 11:03:36 -0300
committerHiltjo Posthuma <hiltjo@codemadness.org>2016-02-23 00:31:03 +0100
commitb3d9451c2ddfad7c1b10e9a868afed4d92b37e41 (patch)
treebe82f1f45f9dfdb08d2fbb3d4ec4500301138cd8
parent3de85ca21cedf2a9f67755afc8ef031a9170b96a (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>
-rw-r--r--arg.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arg.h b/arg.h
index ff1fd13..e94e02b 100644
--- a/arg.h
+++ b/arg.h
@@ -10,8 +10,8 @@ extern char *argv0;
10 10
11/* use main(int argc, char *argv[]) */ 11/* use main(int argc, char *argv[]) */
12#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\ 12#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\
13 argv[0] && argv[0][1]\ 13 argv[0] && argv[0][0] == '-'\
14 && argv[0][0] == '-';\ 14 && argv[0][1];\
15 argc--, argv++) {\ 15 argc--, argv++) {\
16 char argc_;\ 16 char argc_;\
17 char **argv_;\ 17 char **argv_;\