Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dom: Fix accessing first character for std::string (#305)
std::stringの変数について冗長または範囲外なアクセスの可能性を cppcheckに警告されたため条件文を整理して修正します。 cppcheckのレポート ``` src/xml/dom.cpp:133:41: warning: Either the condition 'open_tag.empty()' is redundant or expression 'open_tag[0]' cause access out of bounds. [containerOutOfBounds] bool is_alpha = ( ( open_tag[0] >= 'A' && open_tag[0] <= 'Z' ) || ( open_tag[0] >= 'a' && open_tag[0] <= 'z' ) ); ^ src/xml/dom.cpp:137:31: note: Assuming that condition 'open_tag.empty()' is not redundant if( open_tag.empty() || ! is_alpha ) continue; ^ src/xml/dom.cpp:133:41: note: Access out of bounds bool is_alpha = ( ( open_tag[0] >= 'A' && open_tag[0] <= 'Z' ) || ( open_tag[0] >= 'a' && open_tag[0] <= 'z' ) ); ^ ```
- Loading branch information