summaryrefslogtreecommitdiff
blob: db9d3c6fd158c26c995c73767519c10f00eddc5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--- chaosreader	2011-11-10 19:17:50.000000000 +0100
+++ chaosreader-0.94	2012-03-09 18:15:21.096105305 +0100
@@ -4028,7 +4024,14 @@
 	   ### This causes the replay program to pause
 	   print REPLAY "ms($timediff1);\n";
 	}
-	$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;