]> git.mxchange.org Git - simgear.git/commitdiff
Off by one error when printing exact poweres of ten
authorandy <andy>
Sat, 12 Mar 2005 15:49:53 +0000 (15:49 +0000)
committerandy <andy>
Sat, 12 Mar 2005 15:49:53 +0000 (15:49 +0000)
simgear/nasal/string.c

index fc0acb0408cefde5c64bbf239074b94257ee597a..4d438f08e65a250cd32c849c0c0411b035ba6d30 100644 (file)
@@ -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++; }