Re: Pointer corruption errors...



On Tue, 9 Jan 2001, Craig Durkin wrote:

First off, thanks for your reply. A lot of the stuff that you noted as errors were things I had put in 
there to test if it was some sort of memory issue I was missing. The reason I'm using readdir, instead of 
getdents and stat, is because I had this problem in a previous attempt at this function which used getdents 
and stat, and I wanted to try a different approach. As it stands now, the function is:

I suspected that was the case.

<code snipped> 

This is starting to seem erratic enough that I'm beginning to think that it isn't a result of poor coding. 
:)

Well, what you have there seems to be OK, I might add that returning 1
isn't a good idea (1 is a valid pointer, I think, correct me if I'm 
wrong), but I suspect that you are doing it for testing.  I can't see any
other problems, although I've never done any playing with the internals of
the dirent structure so I can't really check that.  What is that line
supposed to be doing?  Using the while loop and readdir() will step
through all the entries in the directory anyway.

What does the rest of the program do?  Have you tested this function on
it's own?  If so, I'm out of ideas.

Jonathan






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]