From d609e1f7f8fc69886b8ed674b3087c359566f3e9 Mon Sep 17 00:00:00 2001 From: Jacob Nevins Date: Thu, 25 Nov 2004 13:40:01 +0000 Subject: [PATCH] uint64_decimal() incorrectly output 0 as "" instead of "0". This only affected PSFTP's "reput" chat. Spotted by Greg Parker. [originally from svn r4904] --- int64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/int64.c b/int64.c index 7997114a..8a1cda1a 100644 --- a/int64.c +++ b/int64.c @@ -36,11 +36,11 @@ void uint64_decimal(uint64 x, char *buffer) int start = 20; int d; - while (x.hi || x.lo) { + do { x = uint64_div10(x, &d); assert(start > 0); buf[--start] = d + '0'; - } + } while (x.hi || x.lo); memcpy(buffer, buf + start, sizeof(buf) - start); buffer[sizeof(buf) - start] = '\0';