Changeset 8041


Ignore:
Timestamp:
Mar 9, 2009, 11:51:58 PM (13 years ago)
Author:
charles
Message:

(trunk libT) #1906: Huge ratio precision (too many decimal places)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/utils.c

    r8017 r8041  
    15311531    int len;
    15321532    tr_snprintf( tmp, sizeof( tmp ), "%'.64f", d );
    1533     pch = strchr( tmp, '.' );
    1534     pch += places + 1;
     1533    pch = tmp;
     1534    while( isdigit( *pch ) ) ++pch; /* walk to the decimal point */
     1535    ++pch; /* walk over the decimal point */
     1536    pch += places;
    15351537    len = MIN( buflen - 1, pch - tmp );
    15361538    memcpy( buf, tmp, len );
Note: See TracChangeset for help on using the changeset viewer.