Skip to content

Commit

Permalink
uint64_decimal() incorrectly output 0 as "" instead of "0". This only…
Browse files Browse the repository at this point in the history
… affected

PSFTP's "reput" chat. Spotted by Greg Parker.

[originally from svn r4904]
  • Loading branch information
jtn20 committed Nov 25, 2004
1 parent a4ba026 commit d609e1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions int64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit d609e1f

Please sign in to comment.