So right now, my code can open the compact flash card and look for jpg headers byte by byte. It tells me that it has found 16 jpg files (which is what I had anticipated).
However, my concern is detecting parts of jpg files after the initial head has been found and writing it to each jpg file. My problem is that every time I put another if statement (or else if or else) statement below the head detection if statement, the program goes into infinite loop and I'm not sure why.
I've taken steps in eliminating all the unnecessary code and only use printf statements to build a prototype for what I will do, but it just won't work. Even a simple printf statement below the said if statement (line 36) will cause my program to loop non-stop printing that same message!
Can someone help?
Code is posted at http://pastebin.ca/3077969