From 4bded2733a5e2d842df99a6ddaf8457d75f1ba8a Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 17 Aug 2008 16:29:36 +0200 Subject: Adjust debugobj calls to compensate for fz_debugobj printing a newline. --- apps/pdftool.c | 3 +-- mupdf/pdf_outline.c | 4 +--- mupdf/pdf_pagetree.c | 2 +- stream/obj_print.c | 10 ++++------ 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/apps/pdftool.c b/apps/pdftool.c index 15e77ad0..f14629dc 100644 --- a/apps/pdftool.c +++ b/apps/pdftool.c @@ -177,7 +177,7 @@ void showtrailer(void) die(fz_throw("no file specified")); printf("trailer\n"); fz_debugobj(src->trailer); - printf("\n\n"); + printf("\n"); } void showxref(void) @@ -257,7 +257,6 @@ void showobject(int num, int gen) printf("%d %d obj\n", num, gen); fz_debugobj(obj); - printf("\n"); if (pdf_isstream(src, num, gen)) { diff --git a/mupdf/pdf_outline.c b/mupdf/pdf_outline.c index 1a4d7252..270bc96b 100644 --- a/mupdf/pdf_outline.c +++ b/mupdf/pdf_outline.c @@ -135,9 +135,7 @@ pdf_debugoutline(pdf_outline *outline, int level) if (outline->link) fz_debugobj(outline->link->dest); else - printf(""); - - printf("\n"); + printf("\n"); if (outline->child) pdf_debugoutline(outline->child, level + 2); diff --git a/mupdf/pdf_pagetree.c b/mupdf/pdf_pagetree.c index 20486ff3..6333a9bd 100644 --- a/mupdf/pdf_pagetree.c +++ b/mupdf/pdf_pagetree.c @@ -118,9 +118,9 @@ pdf_debugpagetree(pdf_pagetree *pages) int i; printf("<<\n /Type /Pages\n /Count %d\n /Kids [\n", pages->count); for (i = 0; i < pages->count; i++) { + printf(" %% page %d\n", i + 1); printf(" "); fz_debugobj(pages->pref[i]); - printf("\t%% page %d\n", i + 1); } printf(" ]\n>>\n"); } diff --git a/stream/obj_print.c b/stream/obj_print.c index fcbebffd..a63100a1 100644 --- a/stream/obj_print.c +++ b/stream/obj_print.c @@ -315,7 +315,6 @@ void fz_debugobj(fz_obj *obj) { char buf[1024]; - char newline = '\n'; char *ptr; int n; @@ -323,7 +322,8 @@ fz_debugobj(fz_obj *obj) if (n < sizeof buf) { fz_sprintobj(buf, sizeof buf, obj, 0); - fwrite(buf, 1, n, stdout); + fputs(buf, stdout); + fputc('\n', stdout); } else { @@ -331,11 +331,9 @@ fz_debugobj(fz_obj *obj) if (!ptr) return; fz_sprintobj(ptr, n, obj, 0); - fwrite(ptr, 1, n, stdout); + fputs(buf, stdout); + fputc('\n', stdout); fz_free(ptr); } - - fwrite(&newline, 1, 1, stdout); - fflush(stdout); } -- cgit v1.2.3