Skip to content

Commit

Permalink
cppcheck: Fix netstream scan parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxdude42 committed Aug 16, 2020
1 parent 2b8be5e commit bb3aba4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mythtv/libs/libmythtv/mheg/netstream.cpp
Expand Up @@ -8,6 +8,7 @@
using std::getenv;
#include <cstddef>
#include <cstdio>
#include <inttypes.h>
#include <utility>

// Qt
Expand Down Expand Up @@ -327,7 +328,8 @@ static qlonglong inline ContentRange(const QNetworkReply *reply,

// See RFC 2616 14.16: 'bytes begin-end/size'
qulonglong len = 0;
if (3 != std::sscanf(range.constData(), " bytes %20lld - %20lld / %20lld", &first, &last, &len))
const char *fmt = " bytes %20" SCNd64 " - %20" SCNd64 " / %20" SCNd64;
if (3 != std::sscanf(range.constData(), fmt, &first, &last, &len))
{
LOG(VB_GENERAL, LOG_ERR, LOC + QString("Invalid Content-Range:'%1'")
.arg(range.constData()) );
Expand Down

0 comments on commit bb3aba4

Please sign in to comment.