From 366648d96c2bb779844fe1d48acf3458cda6276d Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 1 Jan 2009 16:07:09 +0100 Subject: tibtoa: Save header and footer for later examination --- bin/tibtoa | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/tibtoa b/bin/tibtoa index cdf5bdb..df4e5bc 100755 --- a/bin/tibtoa +++ b/bin/tibtoa @@ -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 = ; 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; -- cgit v1.2.3