# scan for use of banned functions
my $bl = $l;
again:
- if(($l =~ /^(.*?\W)(\w+)(\s*\()/x) && $banfunc{$2}) {
+ if((($l =~ /^(.*?\W)(\w+)(\s*\()/x) && $banfunc{$2}) ||
+ (($l =~ /^(.*?\()(\w+)(\s*\()/x) && $banfunc{$2})) {
my $bad = $2;
my $prefix = $1;
my $suff = $3;
$prefix =~ s/\*/\\*/;
$prefix =~ s/\[/\\[/;
$prefix =~ s/\]/\\]/;
+ $prefix =~ s/\(/\\(/;
$suff =~ s/\(/\\(/;
$l =~ s/$prefix$bad$suff/$prefix$replace/;
goto again;
if(a) b++;
+ if(sprintf(buffer, "%s", moo)) {}
+
// CPP comment ?
/* comment doesn't end
./%LOGDIR/code1185.c:57:7: warning: conditional block on the same line (ONELINECONDITION)
if(a) b++;
^
-./%LOGDIR/code1185.c:59:2: warning: // comment (CPPCOMMENTS)
+./%LOGDIR/code1185.c:59:5: warning: use of sprintf is banned (BANNEDFUNC)
+ if(sprintf(buffer, "%s", moo)) {}
+ ^
+./%LOGDIR/code1185.c:61:2: warning: // comment (CPPCOMMENTS)
// CPP comment ?
^
./%LOGDIR/code1185.c:1:1: error: Missing copyright statement (COPYRIGHT)
./%LOGDIR/code1185.c:1:1: error: Missing closing comment (OPENCOMMENT)
^
-checksrc: 0 errors and 39 warnings
+checksrc: 0 errors and 40 warnings
</stdout>
<errorcode>
5