791c23f93b
measurement and allocation.
48 lines
1.8 KiB
Plaintext
48 lines
1.8 KiB
Plaintext
$OpenBSD: patch-daemon_remote_c,v 1.2 2008/12/27 15:54:43 naddy Exp $
|
|
--- daemon/remote.c.orig Wed Dec 3 00:44:08 2008
|
|
+++ daemon/remote.c Thu Dec 4 17:58:32 2008
|
|
@@ -575,11 +575,11 @@ strlratio2( char * buf, double ratio, size_t buflen )
|
|
else if( (int)ratio == TR_RATIO_INF )
|
|
tr_strlcpy( buf, "Inf", buflen );
|
|
else if( ratio < 10.0 )
|
|
- tr_snprintf( buf, buflen, "%'.2f", ratio );
|
|
+ tr_snprintf( buf, buflen, "%.2f", ratio );
|
|
else if( ratio < 100.0 )
|
|
- tr_snprintf( buf, buflen, "%'.1f", ratio );
|
|
+ tr_snprintf( buf, buflen, "%.1f", ratio );
|
|
else
|
|
- tr_snprintf( buf, buflen, "%'.0f", ratio );
|
|
+ tr_snprintf( buf, buflen, "%.0f", ratio );
|
|
return buf;
|
|
}
|
|
|
|
@@ -609,24 +609,24 @@ strlsize( char * buf,
|
|
if( !size )
|
|
tr_strlcpy( buf, "None", buflen );
|
|
else if( size < (int64_t)KILOBYTE_FACTOR )
|
|
- tr_snprintf( buf, buflen, "%'" PRId64 " bytes", (int64_t)size );
|
|
+ tr_snprintf( buf, buflen, "%" PRId64 " bytes", (int64_t)size );
|
|
else
|
|
{
|
|
double displayed_size;
|
|
if( size < (int64_t)MEGABYTE_FACTOR )
|
|
{
|
|
displayed_size = (double) size / KILOBYTE_FACTOR;
|
|
- tr_snprintf( buf, buflen, "%'.1f KB", displayed_size );
|
|
+ tr_snprintf( buf, buflen, "%.1f KB", displayed_size );
|
|
}
|
|
else if( size < (int64_t)GIGABYTE_FACTOR )
|
|
{
|
|
displayed_size = (double) size / MEGABYTE_FACTOR;
|
|
- tr_snprintf( buf, buflen, "%'.1f MB", displayed_size );
|
|
+ tr_snprintf( buf, buflen, "%.1f MB", displayed_size );
|
|
}
|
|
else
|
|
{
|
|
displayed_size = (double) size / GIGABYTE_FACTOR;
|
|
- tr_snprintf( buf, buflen, "%'.1f GB", displayed_size );
|
|
+ tr_snprintf( buf, buflen, "%.1f GB", displayed_size );
|
|
}
|
|
}
|
|
return buf;
|