mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Fix clang-tidy bugprone-inc-dec-in-conditions warnings
This commit is contained in:
parent
d0bbc61bd4
commit
184757b3db
3 changed files with 13 additions and 4 deletions
|
@ -6,4 +6,5 @@ Checks: [-*,
|
|||
bugprone-incorrect-roundings,
|
||||
bugprone-macro-parentheses,
|
||||
bugprone-multi-level-implicit-pointer-conversion,
|
||||
bugprone-inc-dec-in-conditions,
|
||||
]
|
||||
|
|
|
@ -164,9 +164,17 @@ function parse_ftp_pasv%(str: string%): ftp_port
|
|||
line += 5; // Skip over
|
||||
else if ( line = strchr(s, ','); line != nullptr )
|
||||
{ // Look for comma-separated list.
|
||||
while ( --line >= s && isdigit(*line) )
|
||||
; // Back up over preceding digits.
|
||||
++line; // now points to first digit, or beginning of s
|
||||
do
|
||||
{
|
||||
// Back up over preceding digits. We'll end on the
|
||||
// first digit or the beginning of s.
|
||||
--line;
|
||||
}
|
||||
while ( line >= s && isdigit(*line) );
|
||||
|
||||
// Scoot forward one to point at the first digit or at the
|
||||
// beginning of s.
|
||||
++line;
|
||||
}
|
||||
|
||||
// Make sure we didn't step past the end of the string.
|
||||
|
|
|
@ -142,7 +142,7 @@ void Ident_Analyzer::DeliverStream(int length, const u_char* data, bool is_orig)
|
|||
|
||||
const char* sys_end = (comma && comma < colon) ? comma : colon;
|
||||
|
||||
while ( --sys_end > sys_type && isspace(*sys_end) )
|
||||
for ( ; sys_end > sys_type && isspace(*sys_end); --sys_end )
|
||||
;
|
||||
|
||||
String* sys_type_s = new String((const u_char*)sys_type, sys_end - sys_type + 1, true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue