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:
parent
b7465b8fe5
commit
80f4947e8b
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue