diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2017-01-16 16:37:37 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2017-01-17 17:15:59 +0100 |
commit | 719bdfe6a7976888580a22f0db6fcf21f8372e99 (patch) | |
tree | 141e1739cecca31cd77ac03044f56d03edc82bc2 | |
parent | 78b6502c62fcaac4011cfeb986ab36ee20c60a35 (diff) | |
download | mupdf-719bdfe6a7976888580a22f0db6fcf21f8372e99.tar.xz |
pdf: Minor interpreter cleanups.
-rw-r--r-- | source/pdf/pdf-interpret.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/pdf/pdf-interpret.c b/source/pdf/pdf-interpret.c index 258563ca..1e854256 100644 --- a/source/pdf/pdf-interpret.c +++ b/source/pdf/pdf-interpret.c @@ -853,16 +853,16 @@ pdf_process_stream(fz_context *ctx, pdf_processor *proc, pdf_csi *csi, fz_stream case PDF_TOK_EOF: break; case PDF_TOK_KEYWORD: - if (!strcmp(buf->scratch, "Tw") || !strcmp(buf->scratch, "Tc")) + if (buf->scratch[0] == 'T' && (buf->scratch[1] == 'w' || buf->scratch[1] == 'c') && buf->scratch[2] == 0) { - int l = pdf_array_len(ctx, csi->obj); - if (l > 0) + int n = pdf_array_len(ctx, csi->obj); + if (n > 0) { - pdf_obj *o = pdf_array_get(ctx, csi->obj, l-1); + pdf_obj *o = pdf_array_get(ctx, csi->obj, n-1); if (pdf_is_number(ctx, o)) { csi->stack[0] = pdf_to_real(ctx, o); - pdf_array_delete(ctx, csi->obj, l-1); + pdf_array_delete(ctx, csi->obj, n-1); if (pdf_process_keyword(ctx, proc, csi, stm, buf->scratch) == 0) break; } @@ -995,7 +995,7 @@ pdf_process_stream(fz_context *ctx, pdf_processor *proc, pdf_csi *csi, fz_stream } if (!ignoring_errors) { - fz_warn(ctx, "Ignoring errors during rendering"); + fz_warn(ctx, "ignoring errors during rendering"); ignoring_errors = 1; } /* If we do catch an error, then reset ourselves to a |