fgets fails with ERROR_INVALID_BLOCK error code.

  • Thread starter Thread starter Rupam
  • Start date Start date
R

Rupam

After repeatedly calling fgets in a while(!feof()) Loop
fgets() fails with an Error code "ERROR_INVALID_BLOCK".

##############################
while(!feof(pFile))
{
memset(szString,0,MAXSIZE);
/* Retrieve a line from the configuration file */
pCheckStatus = fgets(szString,MAXSIZE,pFile);
if( NULL == pCheckStatus )
{
if (ferror(pFile) != 0)
{
return 0;
}
break;
}
}
 
Back
Top