Date: Thu, 24 May 2001 19:57:22 +0300 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: "Maverick" Message-Id: <2593-Thu24May2001195721+0300-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9 CC: djgpp AT delorie DOT com In-reply-to: (vhd@chello.at) Subject: Re: code snippet trouble References: Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: "Maverick" > 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?