summaryrefslogtreecommitdiff
blob: 584918513062d6ccb852a2d2ea43ac16a24294ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--- a/chaosreader	2014-06-15 21:30:11.000000000 +0200
+++ b/chaosreader	2019-02-21 18:26:00.671756895 +0100
@@ -4275,7 +4275,14 @@
 	   print REPLAY "ms($timediff1);\n";
 	}
 	$duration = 0.01 if $duration == 0;     # avoid divide by 0,
-	$speed = sprintf("%.2f",$bytes / (1024 * $duration));
+	+       # avoid division by zero
+	# from https://sourceforge.net/tracker/?func=detail&aid=2210488&group_id=107384&atid=647489
+	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;