From: andy Date: Sat, 12 Mar 2005 15:49:53 +0000 (+0000) Subject: Off by one error when printing exact poweres of ten X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=26e70664d651080b66ce3e2f419641c2fdc3164f;p=simgear.git Off by one error when printing exact poweres of ten --- diff --git a/simgear/nasal/string.c b/simgear/nasal/string.c index fc0acb04..4d438f08 100644 --- a/simgear/nasal/string.c +++ b/simgear/nasal/string.c @@ -219,7 +219,7 @@ static int decprint(int val, unsigned char* s) { int p=1, i=0; if(val == 0) { *s = '0'; return 1; } - while(p < 1000000000 && p*10 < val) p *= 10; + while(p < 999999999 && p*10 < val) p *= 10; while(p > 0) { int count = 0; while(val >= p) { val -= p; count++; }