I have a file with the forwarded output of a cmd command. A C program loops though the characters until it reaches the end of the file. But unfortunately there are some EOF indicators in the file before it actually ends. The content of the file is:
Abbildname PID Sitzungsname Sitz.-Nr. Speichernutzung
========================= ======== ================ =========== ===============
System Idle Process 0 Services 0 8 K
System 4 Services 0 5ÿ744 K
smss.exe 440 Services 0 276 K
csrss.exe 616 Services 0 1ÿ924 K
wininit.exe 720 Services 0 944 K
services.exe 792 Services 0 7ÿ892 K
lsass.exe 800 Services 0 14ÿ300 K
svchost.exe 924 Services 0 420 K
fontdrvhost.exe 952 Services 0 680 K
svchost.exe 960 Services 0 23ÿ880 K
WUDFHost.exe 1012 Services 0 7ÿ416 K
svchost.exe 484 Services 0 14ÿ816 K
svchost.exe 544 Services 0 5ÿ196 K
Thats how I read the content of the file:
FILE *file;
file = fopen(completePath, "r");
char character;
while((character=getc(file))!= EOF){
putchar(character);
}
fclose(file);
Any time when there is a 'ÿ' it is interpreted as EOF. How can I fix this so that I read in the whole file and stop when I reach the actual EOF?