mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
gui/dboxinfo: fix bytes2string()
Origin commit data
------------------
Branch: ni/coolstream
Commit: 8839256793
Author: martii <m4rtii@gmx.de>
Date: 2014-01-06 (Mon, 06 Jan 2014)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -181,10 +181,10 @@ static std::string bytes2string(uint64_t bytes, bool binary)
|
|||||||
char result[80];
|
char result[80];
|
||||||
|
|
||||||
if (b < base)
|
if (b < base)
|
||||||
snprintf(result, sizeof(result), "%d%s%02d ", (int)b, g_Locale->getText(LOCALE_UNIT_DECIMAL),
|
snprintf(result, sizeof(result), "%llu%s%02llu ", b, g_Locale->getText(LOCALE_UNIT_DECIMAL),
|
||||||
(int)((bytes - b * factor) * 100 / factor));
|
(bytes - b * factor) * 100 / factor);
|
||||||
else // no need for fractions for larger numbers
|
else // no need for fractions for larger numbers
|
||||||
snprintf(result, sizeof(result), "%d ", (int)bytes);
|
snprintf(result, sizeof(result), "%llu ", b);
|
||||||
|
|
||||||
std::string res(result);
|
std::string res(result);
|
||||||
if (*unit) {
|
if (*unit) {
|
||||||
|
Reference in New Issue
Block a user