Fix potential modulo 0
This commit is contained in:
parent
f40608ef09
commit
0b5ab80b05
7
yes.c
7
yes.c
|
@ -20,8 +20,11 @@ main(int argc, char *argv[])
|
|||
usage();
|
||||
} ARGEND;
|
||||
|
||||
for (i = 0; ;i++, i %= argc) {
|
||||
printf("%s", (argc > 0) ? argv[i] : "y");
|
||||
if (argc == 0)
|
||||
for (;;)
|
||||
puts("y");
|
||||
for (i = 0; ; i++, i %= argc) {
|
||||
printf("%s", argv[i]);
|
||||
putchar((i == argc - 1) ? '\n' : ' ');
|
||||
}
|
||||
return 1; /* should not reach */
|
||||
|
|
Loading…
Reference in New Issue
Block a user