checksrc: detect and remove space before trailing semicolons

This commit is contained in:
Daniel Stenberg
2015-03-17 14:06:48 +01:00
parent 0037eb5805
commit 2dc1a5ce93
8 changed files with 30 additions and 25 deletions

View File

@@ -216,6 +216,11 @@ sub scanfile {
checkwarn($line, length($1)+1, $file, $l, "missing space after close paren");
}
# check for space before the semicolon last in a line
if($l =~ /^(.*[^ ].*) ;$/) {
checkwarn($line, length($1), $file, $l, "space before last semicolon");
}
# scan for use of banned functions
if($l =~ /^(.*\W)(sprintf|vsprintf|strcat|strncat|gets)\s*\(/) {
checkwarn($line, length($1), $file, $l,