mirror of
https://github.com/transmission/transmission.git
synced 2026-05-08 09:39:08 +01:00
possible fix for the -0.0 percent done bug
This commit is contained in:
@@ -379,7 +379,8 @@ tr_cpPercentComplete ( const tr_completion_t * cp )
|
||||
{
|
||||
const uint64_t tilComplete = tr_cpLeftUntilComplete( cp );
|
||||
const uint64_t total = cp->tor->info.totalSize;
|
||||
return 1.0 - (double)tilComplete / total;
|
||||
const float f = 1.0 - (double)tilComplete / total;
|
||||
return MAX(0.0, f);
|
||||
}
|
||||
|
||||
float
|
||||
@@ -387,7 +388,8 @@ tr_cpPercentDone( const tr_completion_t * cp )
|
||||
{
|
||||
const uint64_t tilDone = tr_cpLeftUntilDone( cp );
|
||||
const uint64_t total = cp->tor->info.totalSize;
|
||||
return 1.0 - (double)tilDone / total;
|
||||
const float f = 1.0 - (double)tilDone / total;
|
||||
return MAX(0.0, f);
|
||||
}
|
||||
|
||||
uint64_t
|
||||
|
||||
Reference in New Issue
Block a user