summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/tibtoa10
1 files 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 = <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;