diff options
author | hexcoder- <heiko@hexco.de> | 2022-05-27 15:26:24 +0200 |
---|---|---|
committer | hexcoder- <heiko@hexco.de> | 2022-05-27 15:26:24 +0200 |
commit | 1441503c4328735ce78367b24f71a6f999760113 (patch) | |
tree | a9513d4ba4cc9f369de4411b322e711cc9fd67b4 | |
parent | c96238d85f4a784402db6cbf16630b977617eb1a (diff) | |
download | afl++-1441503c4328735ce78367b24f71a6f999760113.tar.gz |
afl-cmin: avoid messages with \r when redirection is used
-rwxr-xr-x | afl-cmin | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/afl-cmin b/afl-cmin index 853c9398..71723c70 100755 --- a/afl-cmin +++ b/afl-cmin @@ -135,6 +135,12 @@ function exists_and_is_executable(binarypath) { } BEGIN { + if (0 != system( "test -t 1")) { + redirected = 1 + } else { + redirected = 0 + } + print "corpus minimization tool for afl++ (awk version)\n" # defaults @@ -463,7 +469,8 @@ BEGIN { while (cur < in_count) { fn = infilesSmallToBig[cur] ++cur - printf "\r Processing file "cur"/"in_count + if (redirected == 0) { printf "\r Processing file "cur"/"in_count } + else { print " Processing file "cur"/"in_count } # create path for the trace file from afl-showmap tracefile_path = trace_dir"/"fn # gather all keys, and count them @@ -502,7 +509,9 @@ BEGIN { key = field[nrFields] ++tcnt; - printf "\r Processing tuple "tcnt"/"tuple_count" with count "key_count[key]"..." + if (redirected == 0) { printf "\r Processing tuple "tcnt"/"tuple_count" with count "key_count[key]"..." } + else { print " Processing tuple "tcnt"/"tuple_count" with count "key_count[key]"..." } + if (key in keyAlreadyKnown) { continue } |