From 80f4947e8b2f635eb4a20e54671726b9f9b196b4 Mon Sep 17 00:00:00 2001 From: Marc Strapetz Date: Tue, 31 Aug 2010 13:19:48 +0200 Subject: [PATCH] Fix RawParseUtils.formatBase10 to work with negative values Change-Id: Iffa220de76c5e180796fa46c4d67f52a1b3b2e35 Signed-off-by: Shawn O. Pearce --- org.eclipse.jgit/src/org/eclipse/jgit/util/RawParseUtils.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/RawParseUtils.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/RawParseUtils.java index 38e0ddefd..598ebaeb9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/RawParseUtils.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/RawParseUtils.java @@ -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;