seeking back can be performed by the caller, but if the caller doesn't
expect it, it will result in an infinite loop of failures.
fgets(linebuf, buflen, f);
if (feof(f) || ferror(f)) return 0;
if (!strchr(linebuf, '\n')) {
fgets(linebuf, buflen, f);
if (feof(f) || ferror(f)) return 0;
if (!strchr(linebuf, '\n')) {
- if (fseeko(f, -(off_t)strlen(linebuf), SEEK_CUR))
- fscanf(f, "%*[^\n]%*[\n]");
+ fscanf(f, "%*[^\n]%*[\n]");
errno = ERANGE;
return 0;
}
errno = ERANGE;
return 0;
}