The fscanf function in the following code matches the same pattern over and over again in a file, rather than moving on to the next one. How can I fix this?
void checkInput(char *fileName, int time, int* totalProcesses)
{
FILE *input;
int startTime;
int pid;
int prio;
int vruntime = 50;
input = fopen(fileName, "r");
do
{
fscanf(input, "%i start %i prio %i", &pid, &startTime, &prio);
if(startTime == time)
{
createProcess(pid, startTime, vruntime);
totalProcesses++;
printf("%s\n %i", "proccess created", pid );
}
} while ( !feof(input) );
fclose(input);
}