mirror of
https://codeberg.org/scip/Crypt--PWSafe3.git
synced 2025-12-16 12:11:02 +01:00
(needs review)
Resolved problem with warnings Use of uninitialized value within %map2name in hash element at /usr/local/share/perl/5.14.2/Crypt/PWSafe3/Record.pm line 140. occuring on true PasswordSafe file. I am not sure whether this could cause some data to be dropped, but the fix seems consistent with the other code.
This commit is contained in:
@@ -137,7 +137,11 @@ sub addfield {
|
||||
#
|
||||
# add a field to the record
|
||||
my ($this, $field) = @_;
|
||||
$this->{field}->{ $map2name{$field->type} } = $field;
|
||||
my $name = $map2name{$field->type};
|
||||
unless( defined($name) ) {
|
||||
$name = $field->type; # consistent with Field->new
|
||||
}
|
||||
$this->{field}->{ $name } = $field;
|
||||
}
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Reference in New Issue
Block a user