Browse Source

Fix RawParseUtils.formatBase10 to work with negative values

Change-Id: Iffa220de76c5e180796fa46c4d67f52a1b3b2e35
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
tags/v0.9.1
Marc Strapetz 13 years ago
parent
commit
80f4947e8b
1 changed files with 2 additions and 0 deletions
  1. 2
    0
      org.eclipse.jgit/src/org/eclipse/jgit/util/RawParseUtils.java

+ 2
- 0
org.eclipse.jgit/src/org/eclipse/jgit/util/RawParseUtils.java View File

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

Loading…
Cancel
Save