aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/integers.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdlib/integers.c')
-rw-r--r--src/stdlib/integers.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/stdlib/integers.c b/src/stdlib/integers.c
index 86cdeb56..7250e2a2 100644
--- a/src/stdlib/integers.c
+++ b/src/stdlib/integers.c
@@ -32,11 +32,10 @@ static inline Text_t _int64_to_text(int64_t n)
char *p = &buf[19];
bool negative = n < 0;
- if (n == 0)
- *(p--) = '0';
-
- for (; n > 0; n /= 10)
+ do {
*(p--) = '0' + (n % 10);
+ n /= 10;
+ } while (n > 0);
if (negative)
*(p--) = '-';