summaryrefslogtreecommitdiff
path: root/security/chaosreader/files/patch-chaosreader
blob: 6cf52c78f408faeab1c2ffdad4fcb6e62eee6c0b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--- chaosreader.orig	2014-06-15 19:30:11 UTC
+++ chaosreader
@@ -4275,7 +4275,11 @@ END
 	   print REPLAY "ms($timediff1);\n";
 	}
 	$duration = 0.01 if $duration == 0;     # avoid divide by 0,
-	$speed = sprintf("%.2f",$bytes / (1024 * $duration));
+	if ( $duration > 0 ) {
+		$speed = sprintf("%.2f",$bytes / (1024 * $duration));
+	} else {
+		$speed = "unknown";
+	}
 	print REPLAY "print \"\n\n" .
 	 "Summary: $duration2 seconds, $bytes bytes, $speed Kb/sec\\n\";";
 	close REPLAY;