From e7e8164d1f4baccb1c1bfd7c370342456b1a8f29 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sun, 16 Aug 2015 21:54:59 +0000 Subject: Couldn't print out the minimum value for any given signed integer. I fixed the code, but I have a feeling the fix could be much better. I'll look into it later on. --- src/stable/formatter.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/stable/formatter.h') diff --git a/src/stable/formatter.h b/src/stable/formatter.h index 493bca4..fc430f3 100644 --- a/src/stable/formatter.h +++ b/src/stable/formatter.h @@ -90,6 +90,14 @@ namespace Bu { int c = i%fLast.uRadix; i /= fLast.uRadix; + + // I'm not thrilled with this solution, but it's the best I can + // do right now. I'll have to give this more thought later. + if( i < 0 ) + { + i = -i; + c = -c; + } buf[j] = (char)((c<10)?('0'+c):(cBase+c-10)); if( i == 0 ) { -- cgit v1.2.3