MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / fcloseInLoopConditionError

Method fcloseInLoopConditionError

lib/checkio.cpp:412–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410}
411
412void CheckIOImpl::fcloseInLoopConditionError(const Token *tok, const std::string &varname)
413{
414 reportError(tok, Severity::warning,
415 "fcloseInLoopCondition",
416 "fclose() used as loop condition may skip loop body or double-close file handle.\n"
417 "fclose() closes '" + varname + "' each time it is evaluated. On success the loop body might never execute, on failure fclose() might be called again on the already-closed file handle.",
418 CWE910, Certainty::normal);
419}
420
421void CheckIOImpl::seekOnAppendedFileError(const Token *tok)
422{

Callers 1

getErrorMessagesMethod · 0.80

Calls 1

reportErrorFunction · 0.70

Tested by

no test coverage detected