X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/b24a1b1ac51ca3bbacc82700dd1388b7dae2633d..4eaa35207bacee170f0bcf99837ce7fc8b6f0a70:/uip/fmttest.c diff --git a/uip/fmttest.c b/uip/fmttest.c index 2bcebd7a..b39d0d52 100644 --- a/uip/fmttest.c +++ b/uip/fmttest.c @@ -761,7 +761,8 @@ test_trace(void *context, struct format *fmt, int num, char *str, char *outbuf) if (str != ctx->str) { if (changed++) printf(" "); - printf("str=\"%s\"", str ? str : "NULL"); + printf("str="); + litputs(str); ctx->str = str; } @@ -769,7 +770,9 @@ test_trace(void *context, struct format *fmt, int num, char *str, char *outbuf) printf("\n"); if (strcmp(outbuf, ctx->outbuf) != 0) { - printf("outbuf=\"%s\"\n", outbuf); + printf("outbuf="); + litputs(outbuf); + putchar('\n'); free(ctx->outbuf); ctx->outbuf = getcpy(outbuf); } @@ -1165,11 +1168,8 @@ static void litputc(char c) { if (c & ~ 0177) { - putc('M', stdout); - putc('-', stdout); - c &= 0177; - } - if (c < 0x20 || c == 0177) { + printf("\\x%02x", (unsigned char) c); + } else if (c < 0x20 || c == 0177) { if (c == '\b') { putc('\\', stdout); putc('b', stdout);