when showing the stats for selected files, progress on a transfer with no selected files should be 0%, not -100%

This commit is contained in:
Mitchell Livingston 2009-03-14 19:55:24 +00:00
parent 1eb8292844
commit d15d48e75e
1 changed files with 2 additions and 1 deletions

View File

@ -109,7 +109,8 @@ static TR_INLINE float tr_cpPercentComplete( const tr_completion * cp )
static TR_INLINE float tr_cpPercentDone( const tr_completion * cp )
{
return tr_getRatio( cp->sizeNow, tr_cpSizeWhenDone( cp ) );
const double ratio = tr_getRatio( cp->sizeNow, tr_cpSizeWhenDone( cp ) );
return (ratio == TR_RATIO_NA || ratio == TR_RATIO_INF) ? 0.0f : ratio;
}
/**