diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2021-11-15 17:11:30 +0000 |
---|---|---|
committer | Ken Sharp <ken.sharp@artifex.com> | 2021-11-15 17:11:30 +0000 |
commit | b2ee478b1dac1e1684fbfea594cfa8fa6ba59e62 (patch) | |
tree | a061a17460bf9d5d83c5b2bb38973525b9b4eff4 /pdf/ghostpdf.c | |
parent | 737576059bda55dcf95c7c5446258466a69f7f9f (diff) | |
download | ghostpdl-b2ee478b1dac1e1684fbfea594cfa8fa6ba59e62.tar.gz |
GhostPDF - Use the PRIdOFFSET macro for gs_offset_t types
Technically the gs_offset_t can be anything, and in particular can be
either 32 or 64 bits. This makes it awkward to know what format
specifier to use for gs_sprintf and sscanf.
Since Chris added the new PRIdOFFSET macro we can now use that for both
cases. This makes it much less likely that we will try to read a 64-bit
value into a 32-bit variable.
While we're at it, change a few debug statements that were using the
(potentially) wrong format specifier to gs_sprintf.
Diffstat (limited to 'pdf/ghostpdf.c')
-rw-r--r-- | pdf/ghostpdf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pdf/ghostpdf.c b/pdf/ghostpdf.c index 1d25b3c7e..c1af20637 100644 --- a/pdf/ghostpdf.c +++ b/pdf/ghostpdf.c @@ -1282,7 +1282,7 @@ int pdfi_set_input_stream(pdf_context *ctx, stream *stm) byte *b = Buffer + read; /* Success! stop now */ - if(sscanf((char *)b, " %"PRId64"", &ctx->startxref) != 1) { + if(sscanf((char *)b, " %"PRIdOFFSET"", &ctx->startxref) != 1) { dmprintf(ctx->memory, "Unable to read offset of xref from PDF file\n"); } break; |