You closed gfc->mfbuf_p and then open a file with fp, but you're still testing gfc->mfbuf_p. Either you've been working on this code for too long and need a break, or you have serious issues with the language. I suspect it's the former. Take a break.

And btw, don't use feof() to control a loop.