First, I have read the forum's discussion rules, and I have reviewed every post relating to recover.c I can find on reddit, StackExchange, and the other discussion boards. Since none seems to address whatever problem affects my code when run on check50, I'm posting now for help.
This is my code:
https://gist.github.com/bruce-mcgoveran/d487f57a2f6033e735a5f9fef57669bc
This is the data generated by CS50's sandbox:
https://sandbox.cs50.net/checks/1a2ca6ca27404d979d12bd9d3a468fa8
As you will see, my code does not recover the middle and last files correctly. At this point, I have no really good explanations for why not. Perhaps I need to refine how I handle extracting data after the last call to fread(), which I realize may well not return a full buffer's (512 bytes) worth of data. However, I can't see how that relates to my code's failure to identify the middle images in the check50 tests. Lastly, to confirm, my code finds and appears to display correctly the 50 images contained within card.raw.
Thank you in advance for any help you can offer to point me in the right direction. Also, if I need to improve how I present my code for help, please let me know - I'm new to posting.