diff options
Diffstat (limited to 'steprl.c')
-rw-r--r-- | steprl.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/steprl.c b/steprl.c index 5c14a23..d1ae3b9 100644 --- a/steprl.c +++ b/steprl.c @@ -14,10 +14,11 @@ steprl(char *dst, char *end, long n) if (neg) n = -n; - if (!n) - *--s = '0'; - for (; n > 0; n /= 10) - *--s = '0' + (n%10); + do { + *--s = '0' + (n % 10); + n /= 10; + } while (n > 0); + if (neg) *--s = '-'; |