projects
/
transmission
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8c36d86
)
(trunk libT) #3912 "tr_torrentGetMetadataPercent() may return NaN" -- fixed.
author
Jordan Lee
<jordan@transmissionbt.com>
Wed, 19 Jan 2011 00:20:26 +0000
(
00:20
+0000)
committer
Jordan Lee
<jordan@transmissionbt.com>
Wed, 19 Jan 2011 00:20:26 +0000
(
00:20
+0000)
libtransmission/torrent-magnet.c
patch
|
blob
|
history
diff --git
a/libtransmission/torrent-magnet.c
b/libtransmission/torrent-magnet.c
index f8463651cc48aecbeaa10cac974bd74c0d065f37..16d8b60710f75dd9761c09229650e9cc06e595e0 100644
(file)
--- a/
libtransmission/torrent-magnet.c
+++ b/
libtransmission/torrent-magnet.c
@@
-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;