Commit 5ba01762 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[master] Add cppcheck suppressions for sscanf() false-positives

Reviewed by Thomas Markwalder on Jabber.
parent fe418378
......@@ -671,6 +671,7 @@ MasterLoader::MasterLoaderImpl::generateForIter(const std::string& str,
int offset = 0;
unsigned int width;
char base[2] = {'d', 0}; // char plus null byte
// cppcheck-suppress invalidscanf
const int n = sscanf(scan_str, "{%d,%u,%1[doxXnN]}",
&offset, &width, base);
switch (n) {
......@@ -807,6 +808,7 @@ MasterLoader::MasterLoaderImpl::doGenerate() {
unsigned int start;
unsigned int stop;
unsigned int step;
// cppcheck-suppress invalidscanf
const int n = sscanf(range.c_str(), "%u-%u/%u", &start, &stop, &step);
if ((n < 2) || (stop < start)) {
reportError(lexer_.getSourceName(), lexer_.getSourceLine(),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment