projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
prevent CNAME/PTR parsing from reading data past the response end
[musl]
/
src
/
stdio
/
ungetc.c
diff --git
a/src/stdio/ungetc.c
b/src/stdio/ungetc.c
index
7f56f8d
..
bc629d4
100644
(file)
--- a/
src/stdio/ungetc.c
+++ b/
src/stdio/ungetc.c
@@
-6,7
+6,8
@@
int ungetc(int c, FILE *f)
FLOCK(f);
- if ((!f->rend && __toread(f)) || f->rpos <= f->buf - UNGET) {
+ if (!f->rpos) __toread(f);
+ if (!f->rpos || f->rpos <= f->buf - UNGET) {
FUNLOCK(f);
return EOF;
}
@@
-15,5
+16,5
@@
int ungetc(int c, FILE *f)
f->flags &= ~F_EOF;
FUNLOCK(f);
- return c;
+ return
(unsigned char)
c;
}