Skip to content

Commit

Permalink
api: Fix printing of a size_t value
Browse files Browse the repository at this point in the history
size_t is not always the same as long, especially not for 64 bit Windows:

api/pdfrenderer.cpp:549:31: warning:
 format '%ld' expects argument of type 'long int',
 but argument 4 has type 'size_t {aka long long unsigned int}' [-Wformat=]

size_t normally requires a format string "%zu", but this is unsupported
by Visual Studio, so use a type cast.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Nov 5, 2015
1 parent 511e7f7 commit 997c4a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/pdfrenderer.cpp
Expand Up @@ -544,9 +544,9 @@ bool TessPDFRenderer::BeginDocumentHandler() {
n = snprintf(buf, sizeof(buf),
"5 0 obj\n"
"<<\n"
" /Length %ld /Filter /FlateDecode\n"
" /Length %lu /Filter /FlateDecode\n"
">>\n"
"stream\n", len);
"stream\n", (unsigned long)len);
if (n >= sizeof(buf)) {
lept_free(comp);
return false;
Expand Down

0 comments on commit 997c4a6

Please sign in to comment.