summaryrefslogtreecommitdiff
path: root/lib/checksrc.pl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/checksrc.pl')
-rwxr-xr-xlib/checksrc.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/checksrc.pl b/lib/checksrc.pl
index 8f98a99ab..eea1126d1 100755
--- a/lib/checksrc.pl
+++ b/lib/checksrc.pl
@@ -502,7 +502,7 @@ sub scanfile {
}
# check for '== NULL' in if/while conditions but not if the thing on
# the left of it is a function call
- if($nostr =~ /^(.*)(if|while)(\(.*[^)]) == NULL/) {
+ if($nostr =~ /^(.*)(if|while)(\(.*?)([!=]= NULL|NULL [!=]=)/) {
checkwarn("EQUALSNULL", $line,
length($1) + length($2) + length($3),
$file, $l, "we prefer !variable instead of \"== NULL\" comparisons");