projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9cee930
)
make getmntent_r discard long lines when it returns error, not seek back
author
Rich Felker
<dalias@aerifal.cx>
Wed, 28 Sep 2011 23:37:14 +0000
(19:37 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Wed, 28 Sep 2011 23:37:14 +0000
(19:37 -0400)
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.
src/linux/mntent.c
patch
|
blob
|
history
diff --git
a/src/linux/mntent.c
b/src/linux/mntent.c
index f151625285c36e6e92dcd2667c18beb3430a6478..3eafba5e0b387ce98e0aefde2bbdaf8288757af9 100644
(file)
--- a/
src/linux/mntent.c
+++ b/
src/linux/mntent.c
@@
-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')) {
- if (fseeko(f, -(off_t)strlen(linebuf), SEEK_CUR))
- fscanf(f, "%*[^\n]%*[\n]");
+ fscanf(f, "%*[^\n]%*[\n]");
errno = ERANGE;
return 0;
}