Fix RawParseUtils.formatBase10 to work with negative values

Change-Id: Iffa220de76c5e180796fa46c4d67f52a1b3b2e35
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
Marc Strapetz 2010-08-31 13:19:48 +02:00 committed by Shawn O. Pearce
parent b7465b8fe5
commit 80f4947e8b
1 changed files with 2 additions and 0 deletions

View File

@ -155,6 +155,8 @@ public static int formatBase10(final byte[] b, int o, int value) {
return o;
}
final boolean isneg = value < 0;
if (isneg)
value = -value;
while (value != 0) {
b[--o] = base10byte[value % 10];
value /= 10;