gui/dboxinfo: fix bytes2string()

This commit is contained in:
martii
2014-01-06 13:23:39 +01:00
committed by Jacek Jendrzej
parent 6a158066d0
commit 8839256793

View File

@@ -181,10 +181,10 @@ static std::string bytes2string(uint64_t bytes, bool binary)
char result[80];
if (b < base)
snprintf(result, sizeof(result), "%d%s%02d ", (int)b, g_Locale->getText(LOCALE_UNIT_DECIMAL),
(int)((bytes - b * factor) * 100 / factor));
snprintf(result, sizeof(result), "%llu%s%02llu ", b, g_Locale->getText(LOCALE_UNIT_DECIMAL),
(bytes - b * factor) * 100 / factor);
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);
if (*unit) {