| delorie.com/archives/browse.cgi | search |
| 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: | <Xns90AFBDEE83215manniheumanngmxde@130.133.1.4> |
| References: | <k1BP6.1409$vu4 DOT 130732 AT news3 DOT oke DOT nextra DOT no> <Xns90AE75691951Bmanniheumanngmxde AT 130 DOT 133 DOT 1 DOT 4> <c9dQ6.2081$vu4 DOT 202315 AT news3 DOT oke DOT nextra DOT no> <Xns90AF7A1A5C9F0manniheumanngmxde AT 130 DOT 133 DOT 1 DOT 4> <JguQ6.2118$lM3 DOT 46301 AT news1 DOT oke DOT nextra DOT no> |
| 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" <ratspl AT hotmail DOT com> 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
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |