1
0

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>
This commit is contained in:
Lucas Gabriel Vuotto 2016-02-22 11:03:36 -03:00 committed by Hiltjo Posthuma
parent 08979a3abd
commit c57ba0384a

View File

@ -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_;\