diff options
author | Paul Gardiner <paul@glidos.net> | 2012-07-03 13:56:28 +0100 |
---|---|---|
committer | Paul Gardiner <paul@glidos.net> | 2012-07-03 13:56:28 +0100 |
commit | 90ec205dd518ad89a3a04c791b3d84a7adf6c561 (patch) | |
tree | 3c41fa2d1e5f0619a828fd9335d1cd3e199c3766 /pdf/pdf_lex.c | |
parent | a5ae50d9b3e6f4d05d487076fcd5d63117fd8314 (diff) | |
download | mupdf-90ec205dd518ad89a3a04c791b3d84a7adf6c561.tar.xz |
Forms: use more efficient string token printing
Diffstat (limited to 'pdf/pdf_lex.c')
-rw-r--r-- | pdf/pdf_lex.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/pdf/pdf_lex.c b/pdf/pdf_lex.c index 967b6dcc..c0d72da9 100644 --- a/pdf/pdf_lex.c +++ b/pdf/pdf_lex.c @@ -511,13 +511,10 @@ void pdf_print_token(fz_context *ctx, fz_buffer *fzbuf, int tok, pdf_lexbuf *buf fz_buffer_printf(ctx, fzbuf, "/%s", buf->scratch); break; case PDF_TOK_STRING: - { - int i; - fz_buffer_printf(ctx, fzbuf, "<"); - for (i = 0; i < buf->len; i++) - fz_buffer_printf(ctx, fzbuf, "%02X", buf->scratch[i]); - fz_buffer_printf(ctx, fzbuf, ">"); - } + if (buf->len >= buf->size) + pdf_lexbuf_grow(buf); + buf->scratch[buf->len] = 0; + fz_buffer_cat_pdf_string(ctx, fzbuf, buf->scratch); break; case PDF_TOK_OPEN_DICT: fz_buffer_printf(ctx, fzbuf, "<<"); |