From: rkinyon Date: Fri, 7 Apr 2006 01:40:48 +0000 (+0000) Subject: Set header version to 1 X-Git-Tag: 0-99_01~32 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=40fc9162e43e16c724821f19358bb3027c6c3c93;p=dbsrgits%2FDBM-Deep.git Set header version to 1 --- diff --git a/lib/DBM/Deep/Engine.pm b/lib/DBM/Deep/Engine.pm index 3527091..62ee2d7 100644 --- a/lib/DBM/Deep/Engine.pm +++ b/lib/DBM/Deep/Engine.pm @@ -94,7 +94,7 @@ sub write_file_header { seek($fh, $loc + $obj->_root->{file_offset}, SEEK_SET); print( $fh SIG_FILE, - pack('N', 0), + pack('S', 1), pack('S', $self->{long_size}), pack('A', $self->{long_pack}), pack('S', $self->{data_size}), @@ -124,8 +124,7 @@ sub read_file_header { $obj->_throw_error("Signature not found -- file is not a Deep DB"); } - $#values = 4; - if ( grep { !defined } @values ) { + if ( if @values < 5 || grep { !defined } @values ) { die "DBM::Deep: Corrupted file - bad header\n"; } @{$self}{qw( long_size long_pack data_size data_pack max_buckets )} = @values;