From c8d0f6faaf484ab00bb83ce8f6d97a3648fa7cb4 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Fri, 26 Dec 2014 22:14:58 +0100 Subject: [PATCH] yhttpd/mod_sendfile: fix format string warnings Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/44451c75754ebb7b2920a9b5998114e02a5ad86d Author: Stefan Seyfried Date: 2014-12-26 (Fri, 26 Dec 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/yhttpd_mods/Makefile.am | 2 +- src/nhttpd/yhttpd_mods/mod_sendfile.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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);