Bug fixes

This commit is contained in:
Leeland Heins 2019-01-16 13:35:54 -06:00 committed by GitHub
parent 367924be08
commit eff4a1e106
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

6
PO.pm
View File

@ -130,6 +130,12 @@ sub read_blk {
return 0;
}
sub clear_buf {
my ($buf) = @_;
$$buf = pack "C*", 0x00 x 512;
}
#
# Write Track/Sector
#

View File

@ -1011,6 +1011,7 @@ sub read_file {
my $blkno = 1;
foreach my $blk (@blks) {
#print "blkno=$blkno blk=$blk\n";
clear_buf(\$buf2);
if (read_blk($pofile, $blk, \$buf2)) {
dump_blk($buf2) if $debug;
my @bytes = unpack "C*", $buf2;
@ -1083,6 +1084,7 @@ sub get_vol_bit_map {
my $trk = 0;
for (my $blk = $bit_map_pointer; $blk < $bit_map_pointer + $num_vol_bit_map_blks; $blk++) {
clear_buf(\$buf);
if (read_blk($pofile, $bit_map_pointer, \$buf)) {
dump_blk($buf) if $debug;
my (@blks) = parse_vol_bit_map($buf, $debug);