diff --git a/src/nhttpd/yhttpd_mods/Makefile.am b/src/nhttpd/yhttpd_mods/Makefile.am index 2e748d983..da5ad96c4 100644 --- a/src/nhttpd/yhttpd_mods/Makefile.am +++ b/src/nhttpd/yhttpd_mods/Makefile.am @@ -10,7 +10,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/lib/libconfigfile \ @FREETYPE_CFLAGS@ -AM_CPPFLAGS += -fno-rtti -fno-exceptions -D_FILE_OFFSET_BITS=64 +AM_CPPFLAGS += -fno-rtti -fno-exceptions -D_FILE_OFFSET_BITS=64 -D__STDC_FORMAT_MACROS noinst_LIBRARIES = libyhttpdmods.a diff --git a/src/nhttpd/yhttpd_mods/mod_sendfile.cpp b/src/nhttpd/yhttpd_mods/mod_sendfile.cpp index 4807370b0..1d0014665 100644 --- a/src/nhttpd/yhttpd_mods/mod_sendfile.cpp +++ b/src/nhttpd/yhttpd_mods/mod_sendfile.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include // yhttpd #include @@ -118,8 +119,8 @@ THandleStatus CmodSendfile::Hook_PrepareResponse(CyhookHandler *hh) { hh->RangeEnd = hh->ContentLength - 1; const char *range = (hh->HeaderList["Range"] == "") ? NULL : hh->HeaderList["Range"].c_str(); if ((range && - (2 != sscanf(range, "bytes=%lld-%lld", &hh->RangeStart, &hh->RangeEnd)) && - (1 != sscanf(range, "bytes=%lld-", &hh->RangeStart))) + (2 != sscanf(range, "bytes=%" PRId64 "-%" PRId64, &hh->RangeStart, &hh->RangeEnd)) && + (1 != sscanf(range, "bytes=%" PRId64 "-", &hh->RangeStart))) || (hh->RangeStart > hh->RangeEnd) || (hh->RangeEnd > hh->ContentLength - 1)) { hh->SetError(HTTP_REQUEST_RANGE_NOT_SATISFIABLE);