So I’ve been writing a program which scans through files that works just fine when compiled with gcc and clang on Linux. But on Windows, with both Microsoft compiler and MinGW, feof() false-triggers. The loop should break once it detects the end statement of the filetype, the feof is only there as a failsafe and never triggers for correct files on Linux…
I had the programm print the filepointer location with ftell() and the values are just plain wrong. The EOF always triggers at 2^n values which are some orders of magnitude lower than the actual file size...
while(1)
{
...
//File is read here
//normally breaks before EOF-check
if(feof(in))
{
DEBUG_PRINTF("Reached EOF before IEND\n");
break;
}
}
EDIT:
opening the File with "rb" instaed of "r" solved the problem