aboutsummaryrefslogtreecommitdiff
path: root/test-static
blob: 0c22b0dc3d9384e3a97a10c1406a2f98a429a3e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh
# We don't use printf's percent notation with our custom logging mechanism,
# so the compiler cannot check it for us like it usually does
perl -n0777 - "$(dirname "$0")"/degesch.c <<-'END'
	while (/\blog_[^ ]+\s*\([^"()]*"[^"]*%[^%][^"]*"/gm) {
		my ($p, $m) = ($`, $&);
		printf "$ARGV:%d: suspicious log format string: %s...\n",
			(1 + $p =~ tr/\n//), ($m =~ s/\s+/ /rg);
		$status = 1;
	}
	END {
		exit $status;
	}
END