From d15d48e75ecab0fb85ed8eac910db93a75daa3f6 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sat, 14 Mar 2009 19:55:24 +0000 Subject: [PATCH] when showing the stats for selected files, progress on a transfer with no selected files should be 0%, not -100% --- libtransmission/completion.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libtransmission/completion.h b/libtransmission/completion.h index c0ff82c5f..8b556c893 100644 --- a/libtransmission/completion.h +++ b/libtransmission/completion.h @@ -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; } /**