diff options
Diffstat (limited to 'net-analyzer/chaosreader/files/chaosreader-0.94-divisionbyzero.patch')
-rw-r--r-- | net-analyzer/chaosreader/files/chaosreader-0.94-divisionbyzero.patch | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/net-analyzer/chaosreader/files/chaosreader-0.94-divisionbyzero.patch b/net-analyzer/chaosreader/files/chaosreader-0.94-divisionbyzero.patch new file mode 100644 index 000000000000..7f3ec2804dd4 --- /dev/null +++ b/net-analyzer/chaosreader/files/chaosreader-0.94-divisionbyzero.patch @@ -0,0 +1,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 http://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; |