@@ -41,9 +41,12 @@ bool ListBBCode::actualApply(std::string& text, const std::string::size_type off
4141 if (end_pos==std::string::npos) return false ;
4242 std::string::size_type item_pos = find_ci (text, item_code, pos+1 );
4343 // no [*] within opening and closing tag means error
44- if ((item_pos==std::string::npos) or (item_pos>end_pos)) return false ;
44+ if ((item_pos == std::string::npos) || (item_pos > end_pos))
45+ {
46+ return false ;
47+ }
4548 std::string::size_type inner_pos = find_ci (text, code, pos+1 );
46- while ((inner_pos!= std::string::npos) and (inner_pos< end_pos))
49+ while ((inner_pos != std::string::npos) && (inner_pos < end_pos))
4750 {
4851 // malformed code, if next list starts before first list item
4952 if (inner_pos<item_pos) return false ;
@@ -54,7 +57,7 @@ bool ListBBCode::actualApply(std::string& text, const std::string::size_type off
5457 inner_pos = find_ci (text, code, pos+1 );
5558 end_pos = find_ci (text, end_code, pos+1 );
5659 // If there are no more end tags or item "tags" left, the code is invalid.
57- if ((item_pos== std::string::npos) or (end_pos== std::string::npos))
60+ if ((item_pos == std::string::npos) || (end_pos == std::string::npos))
5861 return false ;
5962 }// inner while
6063
@@ -64,7 +67,7 @@ bool ListBBCode::actualApply(std::string& text, const std::string::size_type off
6467 ++end_pos;
6568 item_pos = find_ci (text, item_code, item_pos+3 );
6669 // replace all remaining "[*]" of that list
67- while ((item_pos!= std::string::npos) and (item_pos< end_pos))
70+ while ((item_pos != std::string::npos) && (item_pos < end_pos))
6871 {
6972 text.replace (item_pos, 3 , " </li><li>" );
7073 end_pos += 6 ;
0 commit comments