mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
uint64_decimal() incorrectly output 0 as "" instead of "0". This only affected
PSFTP's "reput" chat. Spotted by Greg Parker. [originally from svn r4904]
This commit is contained in:
parent
a4ba026838
commit
d609e1f7f8
4
int64.c
4
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';
|
||||
|
Loading…
Reference in New Issue
Block a user