From f88240ac2e081b94454203a2d8595b8598a037b3 Mon Sep 17 00:00:00 2001 From: Serge Zaitsev Date: Wed, 24 Nov 2010 00:26:15 +0200 Subject: [PATCH] Simplified demo output format --- demo.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/demo.c b/demo.c index b0c4c92..6508bfe 100644 --- a/demo.c +++ b/demo.c @@ -21,7 +21,7 @@ static void jsmn_dump_obj(jsontok_t *obj, const char *js) { len = obj->end - obj->start; - printf("[%3d,%3d] (%c)\t", obj->start, obj->end, + printf("[%3d,%3d] (%c) ", obj->start, obj->end, ({ char c; switch (obj->type) { @@ -34,7 +34,11 @@ static void jsmn_dump_obj(jsontok_t *obj, const char *js) { })); s = strndup((const char *) &js[obj->start], len); - printf("%s\n", s); + char *p; + for (p = s; *p; p++) { + printf("%c", *p == '\n' ? ' ' : *p); + } + printf("\n", s); free(s); }