diff options
Diffstat (limited to 'src/stdlib/print.c')
| -rw-r--r-- | src/stdlib/print.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/stdlib/print.c b/src/stdlib/print.c index 476ddd7b..8e2dd862 100644 --- a/src/stdlib/print.c +++ b/src/stdlib/print.c @@ -1,4 +1,5 @@ // This file defines some of the helper functions used for printing values +#include <ctype.h> #include <stdio.h> #include <string.h> #include <unistd.h> @@ -170,6 +171,7 @@ public int _print_char(FILE *f, char c) if (name != NULL) return fputs(name, f); else if (isprint(c)) + return fputc('\'', f) + fputc(c, f) + fputc('\'', f); else return (fputs("'\\x", f) + _print_hex(f, hex((uint64_t)c, .digits=2, .no_prefix=true, .uppercase=true)) |
