Changeset 8865


Ignore:
Timestamp:
Aug 3, 2009, 11:18:02 PM (13 years ago)
Author:
charles
Message:

(trunk libT) prevent potential rounding errors when sending floating-point numbers across the wire in json form

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/bencode.c

    r8825 r8865  
    13021302        tr_strlcpy( locale, setlocale( LC_NUMERIC, NULL ), sizeof( locale ) );
    13031303        setlocale( LC_NUMERIC, "POSIX" );
    1304         evbuffer_add_printf( data->out, "%.4f", val->val.d );
     1304        evbuffer_add_printf( data->out, "%.4f", tr_truncd( val->val.d, 4 ) );
    13051305        setlocale( LC_NUMERIC, locale );
    13061306    }
Note: See TracChangeset for help on using the changeset viewer.