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();
|
usage();
|
||||||
} ARGEND;
|
} ARGEND;
|
||||||
|
|
||||||
for (i = 0; ;i++, i %= argc) {
|
if (argc == 0)
|
||||||
printf("%s", (argc > 0) ? argv[i] : "y");
|
for (;;)
|
||||||
|
puts("y");
|
||||||
|
for (i = 0; ; i++, i %= argc) {
|
||||||
|
printf("%s", argv[i]);
|
||||||
putchar((i == argc - 1) ? '\n' : ' ');
|
putchar((i == argc - 1) ? '\n' : ' ');
|
||||||
}
|
}
|
||||||
return 1; /* should not reach */
|
return 1; /* should not reach */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user