You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
char* egets ( char* str, int num, EFILE* stream ){
//if num 0 or 1 stream->pos will not advance
assert(num > 1);
if (eeof(stream) return NULL;
int i = 0;
while(TRUE)
{
//i < (num - 1) so still room for two characters: \n and \0
if ((str[i++] = *(stream->pos++)) == '\n') break;
if (eeof(stream) or (i == (num - 1))) break;
}
str[i] = '\0';
return str;
}
Also, I think it should scan for '\n' instead of '\r'.
Regards,
GW
The text was updated successfully, but these errors were encountered: