From 39fbd4b483c20c526908353d8b3055db1b04dcb4 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 9 May 2018 13:06:29 +0200 Subject: Fix object formatting for null object. --- source/pdf/pdf-object.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/pdf/pdf-object.c b/source/pdf/pdf-object.c index 4360ea7c..44f5ff94 100644 --- a/source/pdf/pdf-object.c +++ b/source/pdf/pdf-object.c @@ -1987,17 +1987,17 @@ static void fmt_obj(fz_context *ctx, struct fmt *fmt, pdf_obj *obj) { char buf[256]; - if (!obj) - fmt_puts(ctx, fmt, ""); + if (obj == PDF_NULL) + fmt_puts(ctx, fmt, "null"); + else if (obj == PDF_TRUE) + fmt_puts(ctx, fmt, "true"); + else if (obj == PDF_FALSE) + fmt_puts(ctx, fmt, "false"); else if (pdf_is_indirect(ctx, obj)) { fz_snprintf(buf, sizeof buf, "%d %d R", pdf_to_num(ctx, obj), pdf_to_gen(ctx, obj)); fmt_puts(ctx, fmt, buf); } - else if (pdf_is_null(ctx, obj)) - fmt_puts(ctx, fmt, "null"); - else if (pdf_is_bool(ctx, obj)) - fmt_puts(ctx, fmt, pdf_to_bool(ctx, obj) ? "true" : "false"); else if (pdf_is_int(ctx, obj)) { fz_snprintf(buf, sizeof buf, "%d", pdf_to_int(ctx, obj)); -- cgit v1.2.3