possible solution for issue #418

This commit is contained in:
Gerold Gruber
2023-10-02 00:21:49 +02:00
parent 4675a17693
commit 7c9939e228
2 changed files with 10 additions and 10 deletions

View File

@@ -70,7 +70,7 @@ typedef struct nwipe_speedring_t_
} nwipe_speedring_t;
#define NWIPE_DEVICE_LABEL_LENGTH 200
#define NWIPE_DEVICE_SIZE_TXT_LENGTH 7
#define NWIPE_DEVICE_SIZE_TXT_LENGTH 8
// Arbitrary length, so far most paths don't exceed about 25 characters
#define MAX_HWMON_PATH_LENGTH 100

View File

@@ -159,25 +159,25 @@ void Determine_C_B_nomenclature( u64 qty, char* result, int result_array_size )
}
/* Determine the size of throughput so that the correct nomenclature can be used */
if( qty >= INT64_C( 1000000000000 ) )
if( qty >= INT64_C( 10000000000000 ) )
{
snprintf( result, result_array_size, "%3llu TB", qty / INT64_C( 1000000000000 ) );
snprintf( result, result_array_size, "%4llu TB", qty / INT64_C( 1000000000000 ) );
}
else if( qty >= INT64_C( 1000000000 ) )
else if( qty >= INT64_C( 10000000000 ) )
{
snprintf( result, result_array_size, "%3llu GB", qty / INT64_C( 1000000000 ) );
snprintf( result, result_array_size, "%4llu GB", qty / INT64_C( 1000000000 ) );
}
else if( qty >= INT64_C( 1000000 ) )
else if( qty >= INT64_C( 10000000 ) )
{
snprintf( result, result_array_size, "%3llu MB", qty / INT64_C( 1000000 ) );
snprintf( result, result_array_size, "%4llu MB", qty / INT64_C( 1000000 ) );
}
else if( qty >= INT64_C( 1000 ) )
else if( qty >= INT64_C( 10000 ) )
{
snprintf( result, result_array_size, "%3llu KB", qty / INT64_C( 1000 ) );
snprintf( result, result_array_size, "%4llu KB", qty / INT64_C( 1000 ) );
}
else
{
snprintf( result, result_array_size, "%3llu B", qty / INT64_C( 1 ) );
snprintf( result, result_array_size, "%4llu B", qty / INT64_C( 1 ) );
}
}