Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcdc!hpfelg!koren From: koren@hpfelg.HP.COM Newsgroups: comp.graphics Subject: Re: Trying to get QRT working... Message-ID: <1140010@hpfelg.HP.COM> Date: 2 Mar 89 15:02:28 GMT References: <7436@pyr.gatech.EDU> Organization: HP Elec. Design Div. -FtCollins Lines: 22 > Actually, it was because of a fault toupper() that worked on anything. I Since toupper() seems to be different across different systems, perhaps I will not use it in any future versions. > The file > "table.qrt" segmentation faults, but all the others seem to work fine. This is a problem in lexer.c. There is only one malloc, which reads: if ((s=malloc(strlen(str)))==NULL) change it to: if ((s=malloc(strlen(str)+1))==NULL) and it should work ok. The problem was that strlen() doesn't count the null byte, so malloc wasn't allocating enough space. Since most malloc()s try to line stuff up on byte boundries, it would would sometimes. Sorry. - steve