Ignore:
Timestamp:
Jun 23, 2007, 2:24:03 AM (14 years ago)
Author:
charles
Message:

possible fix for the -0.0 percent done bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/completion.c

    r2182 r2187  
    380380    const uint64_t tilComplete = tr_cpLeftUntilComplete( cp );
    381381    const uint64_t total = cp->tor->info.totalSize;
    382     return 1.0 - (double)tilComplete / total;
     382    const float f = 1.0 - (double)tilComplete / total;
     383    return MAX(0.0, f);
    383384}
    384385
     
    388389    const uint64_t tilDone = tr_cpLeftUntilDone( cp );
    389390    const uint64_t total = cp->tor->info.totalSize;
    390     return 1.0 - (double)tilDone / total;
     391    const float f = 1.0 - (double)tilDone / total;
     392    return MAX(0.0, f);
    391393}
    392394
Note: See TracChangeset for help on using the changeset viewer.