summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2008-08-17 16:29:36 +0200
committerTor Andersson <tor@ghostscript.com>2008-08-17 16:29:36 +0200
commit4bded2733a5e2d842df99a6ddaf8457d75f1ba8a (patch)
tree7e9203f799df7c7546ef7107152782a37cd03853
parent734fe93caf8107983c1099903aac050286598cda (diff)
downloadmupdf-4bded2733a5e2d842df99a6ddaf8457d75f1ba8a.tar.xz
Adjust debugobj calls to compensate for fz_debugobj printing a newline.
-rw-r--r--apps/pdftool.c3
-rw-r--r--mupdf/pdf_outline.c4
-rw-r--r--mupdf/pdf_pagetree.c2
-rw-r--r--stream/obj_print.c10
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("<nil>");
-
- printf("\n");
+ printf("<nil>\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);
}