Fix numbers larger than 100 terabytes

This commit is contained in:
adrien1018 2018-12-18 21:05:09 +08:00
parent b7b4200f85
commit f15d55c972

View File

@ -277,7 +277,11 @@ void Process_colorNumber(RichString* str, unsigned long long number, bool colori
if ((long long) number == -1LL) {
int len = snprintf(buffer, 13, " no perm ");
RichString_appendn(str, CRT_colors[PROCESS_SHADOW], buffer, len);
} else if (number > 10000000000) {
} else if (number >= 100000000000000) {
xSnprintf(buffer, 13, "%11llu ", number / 1000000);
RichString_appendn(str, largeNumberColor, buffer, 8);
RichString_appendn(str, processMegabytesColor, buffer+8, 4);
} else if (number >= 10000000000) {
xSnprintf(buffer, 13, "%11llu ", number / 1000);
RichString_appendn(str, largeNumberColor, buffer, 5);
RichString_appendn(str, processMegabytesColor, buffer+5, 3);