Division by zero; line 4031
Brought to you by:
brendangregg
Line 4031:
$speed = sprintf("%.2f",$bytes / (1024 * $duration));
If for some odd reason $duration is zero, this would crash the code with a 'division by zero' error.
Since the $speed calculation appears cosmetic anyway, I hastily provided the following fix, which appears to work:
if ( $duration > 0 ) {
$speed = sprintf("%.2f",$bytes / (1024 * $duration));
}
else {
$speed = "unknown";
}
//Provided by Mark Stingley
//cw3sting _AT_ yahoo.com