diff options
author | Daniel Gustafsson <daniel@yesql.se> | 2019-11-28 14:16:02 +0100 |
---|---|---|
committer | Daniel Gustafsson <daniel@yesql.se> | 2019-11-28 14:18:16 +0100 |
commit | ba82673dac3e8d00a76aa5e3779a0cb80e7442af (patch) | |
tree | e3ec5f146e8730255b7645609037a9b946ff40bd /lib/vssh | |
parent | a956a8c5b48414c838129df1c082026fc5a275ab (diff) |
checksrc: fix regexp for ASSIGNWITHINCONDITION
The regexp looking for assignments within conditions was too greedy
and matched a too long string in the case of multiple conditionals
on the same line. This is basically only a problem in single line
macros, and the code which exemplified this was essentially:
do { if((x) != NULL) { x = NULL; } } while(0)
..where the final parenthesis of while(0) matched the regexp, and
the legal assignment in the block triggered the warning. Fix by
making the regexp less greedy by matching for the tell-tale signs
of the if statement ending.
Also remove the one occurrence where the warning was disabled due
to a construction like the above, where the warning didn't apply
when fixed.
Closes #4647
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Diffstat (limited to 'lib/vssh')
-rw-r--r-- | lib/vssh/libssh.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index cad8b3786..070879d94 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -97,7 +97,6 @@ /* A recent macro provided by libssh. Or make our own. */ #ifndef SSH_STRING_FREE_CHAR -/* !checksrc! disable ASSIGNWITHINCONDITION 1 */ #define SSH_STRING_FREE_CHAR(x) \ do { if((x) != NULL) { ssh_string_free_char(x); x = NULL; } } while(0) #endif |