5 static int runOneFile(
const char *fname)
10 FILE *fp = fopen(fname,
"rb");
14 if (fseek(fp, 0L, SEEK_END) != 0) {
19 if (size == (
size_t) -1) {
23 if (fseek(fp, 0L, SEEK_SET) != 0) {
32 if (fread(data, size, 1, fp) != 1) {
45 int main(
int argc,
char **argv)
54 #ifdef AFLFUZZ_PERSISTENT_MODE
55 while (__AFL_LOOP(1000)) {
61 r = runOneFile(argv[1]);
67 if (chdir(argv[1]) != 0) {
69 printf(
"Invalid directory\n");
72 while ((dir = readdir(d)) != NULL) {
73 if (dir->d_type != DT_REG) {
76 r = runOneFile(dir->d_name);
83 #ifdef AFLFUZZ_PERSISTENT_MODE