diff --git a/src/checkdangerousfunctions.cpp b/src/checkdangerousfunctions.cpp index 3d9bfec28..43999b348 100644 --- a/src/checkdangerousfunctions.cpp +++ b/src/checkdangerousfunctions.cpp @@ -77,7 +77,7 @@ void CheckDangerousFunctionsClass::dangerousFunctions() ostr << _tokenizer->fileLine(tok) << ": Found 'mktemp'. You should use 'mkstemp' instead"; _errorLogger->reportErr(ostr.str()); } - else if (Token::Match(tok, "gets|scanf (")) + else if (Token::Match(tok, "gets|scanf (")) { std::ostringstream ostr; ostr << _tokenizer->fileLine(tok) << ": Found '" << tok->str() << "'. You should use 'fgets' instead"; diff --git a/test/testdangerousfunctions.cpp b/test/testdangerousfunctions.cpp index d6e6d9f20..35e79bcfe 100644 --- a/test/testdangerousfunctions.cpp +++ b/test/testdangerousfunctions.cpp @@ -93,7 +93,7 @@ private: check("void f()\n" "{\n" " char *x;\n" - " scanf(\"%s\", x);\n" + " scanf(\"%s\", x);\n" "}\n"); ASSERT_EQUALS(std::string("[test.cpp:4]: Found 'scanf'. You should use 'fgets' instead\n"), errout.str()); }