about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-01-22 21:08:47 +0100
committervan Hauser <vh@thc.org>2020-01-22 21:08:47 +0100
commit9da167dffdc14468d17ac3c1c942e483baf17433 (patch)
treef6142dc6bd7c1a6ff2263febe027e3f25c6943ef
parentce0b9dae5971f22cd0ae0b468322f78ee2a8a766 (diff)
downloadafl++-9da167dffdc14468d17ac3c1c942e483baf17433.tar.gz
fix for modern linux
-rwxr-xr-xafl-cmin.awk11
1 files changed, 6 insertions, 5 deletions
diff --git a/afl-cmin.awk b/afl-cmin.awk
index 28c460e8..fcdfb71f 100755
--- a/afl-cmin.awk
+++ b/afl-cmin.awk
@@ -109,7 +109,7 @@ function exists_and_is_executable(binarypath) {
 }
 
 BEGIN {
-  print "corpus minimization tool for afl-fuzz++ (awk version)\n"
+  print "corpus minimization tool for afl++ (awk version)\n"
 
   # defaults
   extra_par = ""
@@ -289,7 +289,7 @@ BEGIN {
     } else {
       "which afl-showmap 2>/dev/null" | getline path
     }
-    showmap = path
+    showmap = path "/afl-showmap"
   } else {
     showmap = ENVIRON["AFL_PATH"] "/afl-showmap"
   }
@@ -303,11 +303,12 @@ BEGIN {
   i = 0
   # yuck, gnu stat is incompatible to bsd stat
   if ("stat --version 2>/dev/null" !~ /GNU coreutils/) {
-    stat_format = "-f '%z %N'"
-  } else {
+   # I dont get it why this does not work, output is "stat (GNU coreutils) 8.30" and still it goes here ...
     stat_format = "-c '%s %n'"
+  } else {
+    stat_format = "-f '%z %N'"
   }
-  while ("cd "in_dir" && find . -type f -exec stat "stat_format" \{\} \\; | sort -n | cut -d' ' -f2-" | getline) {
+  while ("cd "in_dir" && find . -type f -exec stat "stat_format" \\{\\} \\; | sort -n | cut -d' ' -f2-" | getline) {
     infilesSmallToBig[i++] = $0
   }
   in_count = i