Mail Archives: djgpp/1996/09/13/00:10:24
On 12 Sep 1996, Murrian Family wrote:
> Sounds like the Pointer the FindFirst function returns is 2 bytes off. So
> it is probably a problem with the library. Tell the author about it.
>
> Peter Palotas <rtoodtoo AT freenet DOT hut DOT fi> wrote in article
> <322FB326 DOT 1D97 AT freenet DOT hut DOT fi>...
> > Peter Palotas wrote:
> >
> > Is there a bug in the findfirst() and findnext() functions in DJGPP???
> Or
> > maybe in the ffblk struct. When I make a program that checks for all the
> > files using findfirst() and findnext() passing the addres of an ffblk
> object
> > then printing the filename, the filename is missing the first two
> > characters. I do like this:
> >
> > void main(void)
> > {
> > struct ffblk fileinfo;
> > findfirst("*.*", &fileinfo, FA_ARCH);
> > cprintf("%s\n\r", fileinfo.ff_name);
> > }
> >
> > if I use this statement to print the filename instead everything seems
> to
> > work fine, but this isn't how you should have to do;
> >
> > cprintf("%s\n\r", fileinfo.ff_name - 2);
> >
> > Is this a bug in DJGPP's libraries or am I doing something wrong?
> >
> > Please reply via e-mail to: rtoodtoo AT freenet DOT hut DOT fi
> >
> > //Blizzar
> >
> >
> > Last Second Note: I also discovered that fileinfo.ff_fsize returns a way
> to large
> > number. Although, I copied the example from the help!!!! What
> > is wrong???
One thing I can tell you is this:
when you use:
void main(void)
you stand a chance of letting the compiler produce corrupt code...
This may or may not be your problem.. (Probably not in gcc...
but you never know in other compilers.)
Try:
int main(void)
and a return 0 at the end of your program...
This is where Dos gets its ERRORLEVELs from.. the return value of the
program...
-Sam
- Raw text -