mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-12 18:18:07 +00:00
return instead of exit in test-instr
This commit is contained in:
13
test-instr.c
13
test-instr.c
@ -23,15 +23,19 @@ int main(int argc, char** argv) {
|
|||||||
char buff[8];
|
char buff[8];
|
||||||
char* buf = buff;
|
char* buf = buff;
|
||||||
|
|
||||||
if (argc > 1)
|
// we support command line parameter and stdin
|
||||||
|
if (argc > 1) {
|
||||||
|
|
||||||
buf = argv[1];
|
buf = argv[1];
|
||||||
else if (read(0, buf, sizeof(buf)) < 1) {
|
|
||||||
|
} else if (read(0, buf, sizeof(buf)) < 1) {
|
||||||
|
|
||||||
printf("Hum?\n");
|
printf("Hum?\n");
|
||||||
exit(1);
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// we support three input cases (plus a 4th if stdin is used but there is no input)
|
||||||
if (buf[0] == '0')
|
if (buf[0] == '0')
|
||||||
printf("Looks like a zero to me!\n");
|
printf("Looks like a zero to me!\n");
|
||||||
else if (buf[0] == '1')
|
else if (buf[0] == '1')
|
||||||
@ -39,7 +43,6 @@ int main(int argc, char** argv) {
|
|||||||
else
|
else
|
||||||
printf("Neither one or zero? How quaint!\n");
|
printf("Neither one or zero? How quaint!\n");
|
||||||
|
|
||||||
exit(0);
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user