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

@@ -17,7 +17,7 @@ main(int argc, char *argv[])
ssize_t off;
char *p;
argv0 = argv[0], argc--, argv++;
argv0 = *argv, argv0 ? (argc--, argv++) : (void *)0;
if (argc != 1 && argc != 2)
usage();