| 410 | } |
| 411 | |
| 412 | void 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 | |
| 421 | void CheckIOImpl::seekOnAppendedFileError(const Token *tok) |
| 422 | { |
no test coverage detected