[gcalctool] Fix base suffix



commit 32b562b061c87ee334acf703adae96b587dc8120
Author: Robert Ancell <robert ancell gmail com>
Date:   Sun Apr 18 22:29:18 2010 +1000

    Fix base suffix

 src/mp-convert.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/mp-convert.c b/src/mp-convert.c
index 5b4e4e5..dadd90e 100644
--- a/src/mp-convert.c
+++ b/src/mp-convert.c
@@ -584,10 +584,11 @@ mp_cast_to_string_real(const MPNumber *x, int default_base, int base, int accura
         while (base / multiplier != 0)
             multiplier *= 10;
         while (multiplier != 1) {
-            int d = b / multiplier;
+            int d;
+            multiplier /= 10;
+            d = b / multiplier;
             g_string_append(string, digits[d]);
             b -= d * multiplier;
-            multiplier /= 10;
         }
     }
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]