From: manni DOT heumann AT gmx DOT de (Manni Heumann) Newsgroups: comp.os.msdos.djgpp Subject: Re: Help... classes and optimization problem Date: 28 May 2001 16:40:15 GMT Lines: 24 Message-ID: References: NNTP-Posting-Host: computer-name.uni-bielefeld.de (129.70.100.231) X-Trace: fu-berlin.de 991068015 1243422 129.70.100.231 (16 1428) User-Agent: Xnews/4.05.11 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Vermin" wrote on 28 Mai 2001 in message news:JguQ6.2118$lM3 DOT 46301 AT news1 DOT oke DOT nextra DOT no: > This is the constructor and the function it calls: > > palette::palette(char *file){ > LoadPal(file); > } > > bool palette::LoadPal(char *file){ > uchar sLength = strlen(file); > char ext[4]; Here we are: ext has room for THREE characters plus the mandatory trailing NULL character. > strcpy(ext, (file + sLength - 4)); This will write 4 characters AND the trailing NULL. Add the numbers and you get 5, which is a little bit more than 4. [snip] Manni