about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xafl-plot15
1 files changed, 6 insertions, 9 deletions
diff --git a/afl-plot b/afl-plot
index 1029d5a0..75981d7f 100755
--- a/afl-plot
+++ b/afl-plot
@@ -195,22 +195,19 @@ exit 1
 
 fi
 
+rm -rf "$outputdir/.tmp"
 mkdir -p "$outputdir/.tmp"
-rm -f "$outputdir/.tmp/win_ids"
 mkfifo "$outputdir/.tmp/win_ids" || exit 1
 
 afl-plot-ui > "$outputdir/.tmp/win_ids" &
 W_IDS=$(cat "$outputdir/.tmp/win_ids")
 
-rm -f "$outputdir/.tmp/win_ids"
-if [ -z "$(ls -A $outputdir/.tmp)" ]; then
-	rm -rf "$outputdir/.tmp"
-fi
+rm -rf "$outputdir/.tmp"
 
-W_ID1=$(echo "$W_IDS" | head -1)
-W_ID2=$(echo "$W_IDS" | head -2 | tail -1)
-W_ID3=$(echo "$W_IDS" | head -3 | tail -1)
-W_ID4=$(echo "$W_IDS" | tail -1)
+W_ID1=$(echo "$W_IDS" | head -n 1)
+W_ID2=$(echo "$W_IDS" | head -n 2 | tail -n 1)
+W_ID3=$(echo "$W_IDS" | head -n 3 | tail -n 1)
+W_ID4=$(echo "$W_IDS" | tail -n 1)
 
 echo "[*] Generating plots..."