So i seem to be stuck in an infinite loop, never being able to find the end of my file. I have tried these two statements to try and find the end of the loops but neither work, I'm not sure why.
while(fgets((char *)buffer, sizeof(buffer), inptr) != NULL)
while(!feof(inptr))
Also when i try to debug my program with debug50 the program ends between these lines and exits, i have tried stepping into the function and stepping over but neither work. Which is a real pain when trying to figure out whats wrong
fread(buffer, 512, 1, inptr);
}
while (checkBuffer(buffer) == false);
I used a printf to see how many loops the program does, which is 50 before 'File size limit exceeded'error happens. 50 .jpg files are produced all of which are fine apart from the last one due to an unsupported file type.
Any help with these three issues is greatly appreciated
Issue was fixed by using this code instead
while (checkBuffer(buffer) == false && !feof(inptr));