aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2014-10-30 11:56:30 -0400
committerMichael Mann <mmann78@netscape.net>2014-10-30 17:57:00 +0000
commitcc640f03b959c90e8a9bfe9afe7c56b30caa6b41 (patch)
tree8b4b4c5bf5e14d6e7a6f18a4c7145ff12f6347ea /tools
parent4210a8cbed1f69fafb396b142a8a06f624a3a3b6 (diff)
Prohibit ctype APIs (except toupper() which is still used by file.c - make
that deprecated). Also remove a few tabs that were in there. Change-Id: I1bb2ad726828366a9f7d1a4064b1215b743ad3b5 Reviewed-on: https://code.wireshark.org/review/5000 Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/checkAPIs.pl33
1 files changed, 26 insertions, 7 deletions
diff --git a/tools/checkAPIs.pl b/tools/checkAPIs.pl
index e5402cd3fe..e08096bf36 100755
--- a/tools/checkAPIs.pl
+++ b/tools/checkAPIs.pl
@@ -96,6 +96,19 @@ my %APIs = (
# "I" isn't always the upper-case form of "i", and "i" isn't
# always the lower-case form of "I"). Use the g_ascii_* version
# instead.
+ 'isalnum',
+ 'isascii',
+ 'isalpha',
+ 'iscntrl',
+ 'isdigit',
+ 'islower',
+ 'isgraph',
+ 'isprint',
+ 'ispunct',
+ 'isspace',
+ 'isupper',
+ 'isxdigit',
+ 'tolower',
'strtod',
'strcasecmp',
'strncasecmp',
@@ -193,7 +206,13 @@ my %APIs = (
'ep_strbuf_append_c',
'ep_strbuf_append_unichar',
'ep_strbuf_truncate',
- 'emem_print_tree'
+ 'emem_print_tree',
+ # Locale-unsafe APIs
+ # These may have unexpected behaviors in some locales (e.g.,
+ # "I" isn't always the upper-case form of "i", and "i" isn't
+ # always the lower-case form of "I"). Use the g_ascii_* version
+ # instead.
+ 'toupper'
] },
# APIs that SHOULD NOT be used in Wireshark (any more)
@@ -1851,14 +1870,14 @@ sub check_hf_entries($$)
print STDERR "Error: $hf uses RVALS but 'display' does not include BASE_RANGE_STRING in $filename\n";
$errorCount++;
}
- if ($convert =~ m/^VALS\(&.*\)/) {
+ if ($convert =~ m/^VALS\(&.*\)/) {
print STDERR "Error: $hf is passing the address of a pointer to VALS in $filename\n";
$errorCount++;
- }
- if ($convert =~ m/^RVALS\(&.*\)/) {
+ }
+ if ($convert =~ m/^RVALS\(&.*\)/) {
print STDERR "Error: $hf is passing the address of a pointer to RVALS in $filename\n";
$errorCount++;
- }
+ }
if ($convert !~ m/^((0[xX]0?)?0$|NULL$|VALS|VALS64|RVALS|TFS|&)/ && $display !~ /BASE_CUSTOM/) {
print STDERR "Error: non-null $hf 'convert' field missing 'VALS|VALS64|RVALS|TFS|&' in $filename ?\n";
$errorCount++;
@@ -2078,8 +2097,8 @@ while ($_ = $ARGV[0])
my $line;
if ($source_dir and ! -e $filename) {
- $filename = $source_dir . '/' . $filename;
- }
+ $filename = $source_dir . '/' . $filename;
+ }
if (! -e $filename) {
warn "No such file: \"$filename\"";
next;