From 4328e601f885a4a31c79e126186e8438c9dab273 Mon Sep 17 00:00:00 2001 From: Nigel Horne Date: Thu, 19 Dec 2024 07:10:01 -0500 Subject: [PATCH] Improved arg checking --- gedcom | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gedcom b/gedcom index 759e36e..f16da61 100755 --- a/gedcom +++ b/gedcom @@ -14006,10 +14006,14 @@ sub get_params return { $default => shift }; } elsif($num_args == 1) { Carp::croak('Usage: ', __PACKAGE__, '->', (caller(1))[3], '()'); - } elsif($num_args == 0 && defined $default) { + } elsif(($num_args == 0) && (defined($default))) { Carp::croak('Usage: ', __PACKAGE__, '->', (caller(1))[3], '($default => \$val)'); } elsif(($num_args % 2) == 0) { %rc = @_; + } elsif($num_args == 0) { + return; + } else { + Carp::croak('Usage: ', __PACKAGE__, '->', (caller(1))[3], '()'); } return \%rc;