From: izydorst Date: Fri, 17 Oct 2003 13:48:43 +0000 (+0000) Subject: VLIR linker malloc's memory, fixes X-Git-Tag: V2.12.0~1247 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d4043e87ec49c1285ea78c6446470113d9828fd1;p=cc65 VLIR linker malloc's memory, fixes git-svn-id: svn://svn.cc65.org/cc65/trunk@2546 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/grc/grc.c b/src/grc/grc.c index ab2874f6d..37833bfb2 100644 --- a/src/grc/grc.c +++ b/src/grc/grc.c @@ -35,7 +35,7 @@ void VLIRLinker(int argc, char *argv[]) { FILE *outCVT, *input; -unsigned char buffer[THIS_BUFFER_IS_SOOO_HUGE]; +unsigned char *buffer; unsigned char vlirtabt[127]; unsigned char vlirtabs[127]; int i,j,lastarg; @@ -60,7 +60,10 @@ int blocks,rest; if (input==NULL) AbEnd("can't open input:%s\n",strerror(errno)); - bytes = fread(buffer,1,BLOODY_BIG_BUFFER,input); + buffer = malloc(THIS_BUFFER_IS_SOOO_HUGE); + memset(buffer,0,THIS_BUFFER_IS_SOOO_HUGE); + + bytes = fread(buffer,1,1024,input); fclose(input); if (bytes!=508) AbEnd("%s is not a cvt header\n",argv[i]); @@ -70,9 +73,9 @@ int blocks,rest; /* now put 254 bytes of VLIR table, to update later */ /* clear out things */ - memset(buffer,0,254); + memset(buffer,0,512); fwrite(buffer,1,254,outCVT); - for (j=0;j!=126;j++) { + for (j=0;j