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

2
yes.c
View File

@@ -8,7 +8,7 @@ main(int argc, char *argv[])
{
char **p;
argv0 = argv[0], argc--, argv++;
argv0 = *argv, argv0 ? (argc--, argv++) : (void *)0;
for (p = argv; ; p = (*p && *(p + 1)) ? p + 1 : argv) {
fputs(*p ? *p : "y", stdout);