View Single Post
Old 02-24-2005, 12:04 PM  
odog
Junior Member
 
Join Date: Feb 2003
Posts: 14
Default quickfix: Warning: Division by zero in D:\ioFTPD\scripts\psio\funcs.php on line 4

saw you guys had some problem with this error when uploading a file and no sfv exists. this gets rid of the msg.
and yes i know it aint all that nice but atleast it works!
replace in funcs.php (at the top of the file):

function progressmeter($total,$found) {
$dpercent = round($found/$total,1);
$bars = round(20*$dpercent,0);
return str_repeat("#",$bars).str_repeat("-",20-$bars);
}

with

function progressmeter($total,$found) {
if ( $total == "" ) {
return str_repeat("#",0).str_repeat("-",20-0);
} else {
$dpercent = round($found/$total,1);
$bars = round(20*$dpercent,0);
return str_repeat("#",$bars).str_repeat("-",20-$bars);
}
}
odog is offline