Mail Archives: djgpp/2001/05/24/12:59:18
> From: "Maverick" <vhd AT chello DOT at>
> Newsgroups: comp.os.msdos.djgpp
> Date: Thu, 24 May 2001 10:49:10 GMT
>
> void create_new_palette(void)
> {
> int z;
> char fullpath[22]="tiles.bmp\\";
> char filename[6];
> struct find_t chkfile;
> FILE *liste, *graphic;
> set_standard_colors(); <-does
> nothing right now
> liste=fopen("tiles.bmp\\chktiles.lst","wb");
> if(_dos_findfirst("tiles.bmp\\*dt.bmp", 0, &chkfile)) <- seems to be
> wrong
> do
> {
> fputc(chkfile.name[0], liste);
> fputc(chkfile.name[1], liste);
The logic is backwards here: _dos_findfirst returns zero when it
succeeds, non-zero otherwise.
Also, why do you use _dos_findfirst instead of findfirst? The latter
supports long file names on Windows, while the former does not.
> while (!_dos_findnext(&chkfile)); <- I guess that's my big error
> --------- Code below isn't reached and I don't know why -------------------
Why do you call _dos_findnext at all, if you have no use for the
results it returns?
- Raw text -