Core: FormatIntAlpha fixed (thanks omari)

git-svn-id: svn://ultimatepp.org/upp/trunk@11889 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2018-04-13 12:18:48 +00:00
parent 584406dcf2
commit d13cf462b4

View file

@ -92,14 +92,12 @@ String FormatIntAlpha(int i, bool upper)
out << '-';
i = -i;
}
char temp[10], *p = temp;
i--;
char start = (upper ? 'A' : 'a');
char temp[10], *p = temp + 10;
const char *itoc = upper ? "ZABCDEFGHIJKLMNOPQRSTUVWXYZ" : "zabcdefghijklmnopqrstuvwxyz";
do
*p++ = start + (i % 26);
*--p = itoc[i-- % 26];
while(i /= 26);
while(p > temp)
out << *--p;
out.Cat(p, temp + 10);
return out;
}