projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
fix mismatched signatures for strtod_l family
[musl]
/
src
/
stdio
/
fgetln.c
diff --git
a/src/stdio/fgetln.c
b/src/stdio/fgetln.c
index
afe12b5
..
5748435
100644
(file)
--- a/
src/stdio/fgetln.c
+++ b/
src/stdio/fgetln.c
@@
-8,7
+8,7
@@
char *fgetln(FILE *f, size_t *plen)
ssize_t l;
FLOCK(f);
ungetc(getc_unlocked(f), f);
- if ((z=memchr(f->rpos, '\n', f->rend - f->rpos))) {
+ if (
f->rend &&
(z=memchr(f->rpos, '\n', f->rend - f->rpos))) {
ret = (char *)f->rpos;
*plen = ++z - ret;
f->rpos = (void *)z;