Fixed #2533 (false positive: (error) Uninitialized variable: cBuffer)

This commit is contained in:
Daniel Marjamäki 2011-02-03 22:29:32 +01:00
parent 398190460f
commit 39c68e12ce
2 changed files with 6 additions and 1 deletions

View File

@ -71,7 +71,6 @@ void CheckNullPointer::parseFunctionCall(const Token &tok, std::list<const Token
functionNames1.insert("strstr");
functionNames1.insert("fclose");
functionNames1.insert("feof");
functionNames1.insert("fread");
functionNames1.insert("fwrite");
functionNames1.insert("fseek");
functionNames1.insert("ftell");

View File

@ -1412,6 +1412,12 @@ private:
" return cmd[0];\n"
"}\n");
ASSERT_EQUALS("", errout.str());
checkUninitVar("char fn(FILE *f) {\n"
" char buf[10];\n"
" fread(buf, 1, 10, f);\n"
"}\n");
ASSERT_EQUALS("", errout.str());
}
void uninitvar_typeof()