Handle { NULL } argv[] properly in manual arg-reduction

Thanks izabera for reporting this!
This commit is contained in:
Laslo Hunhold
2017-08-05 23:50:39 +02:00
parent ea8622a4ce
commit e92a1aef54
22 changed files with 24 additions and 23 deletions

View File

@@ -13,7 +13,7 @@ usage(void)
int
main(int argc, char *argv[])
{
argv0 = argv[0], argc--, argv++;
argv0 = *argv, argv0 ? (argc--, argv++) : (void *)0;
if (argc != 1)
usage();