mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +00:00
(trunk libT) #3912 "tr_torrentGetMetadataPercent() may return NaN" -- fixed.
This commit is contained in:
parent
8c36d86d4a
commit
ba5172150a
1 changed files with 1 additions and 1 deletions
|
@ -358,7 +358,7 @@ tr_torrentGetMetadataPercent( const tr_torrent * tor )
|
||||||
ret = 1.0;
|
ret = 1.0;
|
||||||
else {
|
else {
|
||||||
const struct tr_incomplete_metadata * m = tor->incompleteMetadata;
|
const struct tr_incomplete_metadata * m = tor->incompleteMetadata;
|
||||||
if( m == NULL )
|
if( !m || !m->pieceCount )
|
||||||
ret = 0.0;
|
ret = 0.0;
|
||||||
else
|
else
|
||||||
ret = (m->pieceCount - m->piecesNeededCount) / (double)m->pieceCount;
|
ret = (m->pieceCount - m->piecesNeededCount) / (double)m->pieceCount;
|
||||||
|
|
Loading…
Reference in a new issue