mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-08 10:50:28 +00:00
Do not format int
as a non-printable character
Output gets truncated otherwise.
This commit is contained in:
parent
81f391dd22
commit
03788b0117
1 changed files with 1 additions and 1 deletions
|
@ -29,7 +29,7 @@ char *testlib_formatint(intptr_t x) {
|
||||||
char *str = sbufi_ < ARRAYLEN(sbufs_) ? sbufs_[sbufi_++] : malloc(256);
|
char *str = sbufi_ < ARRAYLEN(sbufs_) ? sbufs_[sbufi_++] : malloc(256);
|
||||||
char *p = str;
|
char *p = str;
|
||||||
p += sprintf(p, "%ld\t(or %#lx", x, x);
|
p += sprintf(p, "%ld\t(or %#lx", x, x);
|
||||||
if (0 <= x && x < 256) {
|
if (32 <= x && x < 256) {
|
||||||
p += sprintf(p, " or %#`c", (unsigned char)x);
|
p += sprintf(p, " or %#`c", (unsigned char)x);
|
||||||
}
|
}
|
||||||
*p++ = ')';
|
*p++ = ')';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue