From 03788b0117726da1018290bd48b8efed6f35ba4c Mon Sep 17 00:00:00 2001 From: mataha Date: Tue, 12 Sep 2023 21:28:54 +0200 Subject: [PATCH] Do not format `int` as a non-printable character Output gets truncated otherwise. --- libc/testlib/formatint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/testlib/formatint.c b/libc/testlib/formatint.c index fdfc8b345..4fbe23107 100644 --- a/libc/testlib/formatint.c +++ b/libc/testlib/formatint.c @@ -29,7 +29,7 @@ char *testlib_formatint(intptr_t x) { char *str = sbufi_ < ARRAYLEN(sbufs_) ? sbufs_[sbufi_++] : malloc(256); char *p = str; 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++ = ')';