From a5eefc27343b33eae1957378f37148a21f243492 Mon Sep 17 00:00:00 2001 From: izydorst Date: Thu, 6 Feb 2003 02:00:33 +0000 Subject: [PATCH] fixed VLIR linker (case when chain length was equal to n*254) git-svn-id: svn://svn.cc65.org/cc65/trunk@1931 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/grc/grc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/grc/grc.c b/src/grc/grc.c index e48bffbff..084849883 100644 --- a/src/grc/grc.c +++ b/src/grc/grc.c @@ -96,8 +96,13 @@ int blocks,rest; if (bytes==0) AbEnd("couldn't read %s:%s\n",argv[i],strerror(errno)); blocks = bytes / 254; - rest = bytes % 254 + 1; - if (rest>255) rest=255; + rest = bytes % 254; + if (rest==0) { + rest = 255; + --blocks; + } else { + ++rest; + } vlirtabt[j]=blocks+1; vlirtabs[j]=rest; fwrite(buffer,1,(blocks+1)*254,outCVT); } -- 2.39.5