1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-30 13:18:05 +03:00

added some paranoid checking for enums

(This used to be commit 3492f37b0b)
This commit is contained in:
Andrew Tridgell 2003-11-26 01:13:00 +00:00
parent 49a85dc890
commit 06942f3ddb

View File

@ -57,7 +57,8 @@ sub HeaderElement($)
}
}
if (defined $element->{ARRAY_LEN} &&
!util::is_constant($element->{ARRAY_LEN})) {
!util::is_constant($element->{ARRAY_LEN}) &&
!$element->{POINTERS}) {
# conformant arrays are ugly! I choose to implement them with
# pointers instead of the [1] method
$res .= "*";
@ -105,7 +106,9 @@ sub HeaderEnum($$)
my $e = ${$els}[$#{$els}];
tabs();
chomp $e;
$e =~ /^(.*?)\s*$/;
if ($e !~ /^(.*?)\s*$/) {
die "Bad enum $name\n";
}
$res .= "$1\n";
$tab_depth--;
$res .= "}";