Postby lzsiga » Mon Feb 09, 2004 16:36
I have found a strange bug in CRTE V02.4A15, which can be reproduced with teh following program:<P>/* fwrt.c */<P>#include <stdio.h><BR>#include <stdlib.h><BR>#include <string.h><P>int main (int argc, char **argv)<BR>{<BR> FILE *f;<BR> char *buff;<BR> int i;<P> buff = malloc (16384);<BR> system ("FILE FWRTEST,LINK=FWRLINK,FCBTYPE=PAM");<BR> f = fopen ("link=FWRLINK", "wb");<BR> if (f==NULL) {<BR> perror ("fopen");<BR> exit (12);<BR> }<BR> if (argc>1 && strcasecmp (argv[1], "fprintf")==0) {<BR> fprintf (f, "--HEADER--");<BR> } else {<BR> fwrite ("--HEADER--", 1, 10, f);<BR> }<BR> for (i=0; i<8300; ++i) {<BR> fwrite (buff, 1, 16384, f);<BR> }<BR> fclose (f);<BR> return 0;<BR>}<P>The program will die if started with option "fprintf" and will work if started with option "fwrite"