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;
}
}
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;
}
}