yhttpd/mod_sendfile: fix format string warnings

Origin commit data
------------------
Branch: ni/coolstream
Commit: 44451c7575
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2014-12-26 (Fri, 26 Dec 2014)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2014-12-26 22:14:58 +01:00
parent 7ea5b62340
commit c8d0f6faaf
2 changed files with 4 additions and 3 deletions

View File

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

View File

@@ -46,6 +46,7 @@
#include <pthread.h>
#include <sys/stat.h>
#include <unistd.h>
#include <inttypes.h>
#include <system/helpers.h>
// yhttpd
#include <yconfig.h>
@@ -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);