diff --git a/arg.h b/arg.h index 003f8ec..cf30d65 100644 --- a/arg.h +++ b/arg.h @@ -22,7 +22,7 @@ extern char *argv0; /* int main(int argc, char *argv[]) */ -#define ARGBEGIN for (argv0 = *argv, argc--, argv++; \ +#define ARGBEGIN for (argv0 = *argv, *argv ? (argc--, argv++) : ((void *)0); \ *argv && (*argv)[0] == '-' && (*argv)[1]; argc--, argv++) { \ int argparsed; \ if ((*argv)[1] == '-' && (*argv)[2] == '\0') { \