fix NaN error reported by persept

This commit is contained in:
Charles Kerr 2007-08-21 16:26:01 +00:00
parent 764f2983d3
commit 44f6cb1098
1 changed files with 1 additions and 1 deletions

View File

@ -311,7 +311,7 @@ tr_cpPercentDone( const tr_completion_t * cp )
{
tr_cpEnsureDoneValid( cp );
return (double)cp->doneHave / cp->doneTotal;
return cp->doneTotal ? (double)cp->doneHave / cp->doneTotal : 1.0;
}
uint64_t