I need to know if I am overlooking something, or just doing something wrong. I have a function to do a thing, in that function I declare FF_FILE *fileIn and then call another function to open that file and read some header info. fileIn is passed as a function parameter FF_FILE *fileHandle. The debugs in my opening function show the file is being opened and read, and my data is coming in correct, but when it returns and I check the file handle it always fails (!fileIn) and I abort. If I open the file before calling that function (and comment out the ff_fopen in that function) everything works. So why isn’t the handle coming back to me in the original code?
FF_FILE *fileIn;
open_dat_file(&hdrStruct, fileIn);
if (!fileIn)
{
printf("FILE NOT OPENED\n);
return 1;
}
....do stuff .....
.
.
.
void open_dat_file(DAT_HDR_T *header, FF_FILE *fileHandle)
{
ff_fopen(..bla bla bla)
if (!fileHandle)
{
return;
}
.
.
.
.
I have already made the modifications to get around it, but I just want to make sure I don’t end up with similar issues in the future.