api: Fix printing of a size_t value

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>
This commit is contained in:
Stefan Weil 2015-11-05 06:29:47 +01:00 committed by Zdenko Podobný
parent c0f4e86ef5
commit cd946dc30d

View File

@ -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;