diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/tibtoa | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -8,8 +8,9 @@ use utf8; use Getopt::Std; binmode(STDOUT, ':utf8'); -my $header = 74; -my $footer = 2; +my $headerlength = 74; +my $footerlength = 2; +my ($header, $footer); my ($char, $char2); my $out; my $cache; @@ -619,13 +620,12 @@ getopts('i', \%opts); open(PRGM, '<', shift) or die; binmode(PRGM); -# Remove header added by tilp2 -seek(PRGM, $header, 0); +read(PRGM, $header, $headerlength); $program = <PRGM>; close(PRGM); # The last two bytes don't contain program code -substr($program, -$footer, $footer, ''); +$footer = substr($program, -$footerlength, $footerlength, ''); $length = length($program); $offset = 0; |