Changeset 8764 for trunk/qt/details.cc


Ignore:
Timestamp:
Jun 30, 2009, 10:27:22 PM (13 years ago)
Author:
charles
Message:

(trunk gtk,qt) fix possible division by zero in the torrent properties dialog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/details.cc

    r8756 r8764  
    268268        string = none;
    269269    else {
    270         QString pct = locale.toString( 100.0*((sizeWhenDone-leftUntilDone)/sizeWhenDone), 'f', 2 );
     270        const double d = 100.0 * ( sizeWhenDone ? ( sizeWhenDone - leftUntilDone ) / sizeWhenDone : 1 );
     271        QString pct = locale.toString( d, 'f', 2 );
    271272        if( !haveUnverified )
    272273            string = tr( "%1 (%2%)" )
Note: See TracChangeset for help on using the changeset viewer.