mirror of
https://github.com/transmission/transmission
synced 2024-12-24 16:52:39 +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;
|
||||
else {
|
||||
const struct tr_incomplete_metadata * m = tor->incompleteMetadata;
|
||||
if( m == NULL )
|
||||
if( !m || !m->pieceCount )
|
||||
ret = 0.0;
|
||||
else
|
||||
ret = (m->pieceCount - m->piecesNeededCount) / (double)m->pieceCount;
|
||||
|
|
Loading…
Reference in a new issue