make getmntent_r discard long lines when it returns error, not seek back
[musl] / src / linux / mntent.c
index f151625..3eafba5 100644 (file)
@@ -25,8 +25,7 @@ struct mntent *getmntent_r(FILE *f, struct mntent *mnt, char *linebuf, int bufle
                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;
                }