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:
a48ccc1
)
allow fmemopen with zero size
author
Rich Felker
<dalias@aerifal.cx>
Tue, 25 Jun 2019 21:47:12 +0000
(17:47 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Tue, 25 Jun 2019 21:47:12 +0000
(17:47 -0400)
previously, POSIX erroneously required this to fail with EINVAL
despite the traditional glibc implementation, on which the POSIX
interface was based, allowing it. the resolution of Austin Group issue
818 removes the requirement to fail.
src/stdio/fmemopen.c
patch
|
blob
|
history
diff --git
a/src/stdio/fmemopen.c
b/src/stdio/fmemopen.c
index 82413b2d8d8386ab17b46fc49c68820551dd5deb..5685092e36018247bb7308bbce5db18416b8b3f9 100644
(file)
--- a/
src/stdio/fmemopen.c
+++ b/
src/stdio/fmemopen.c
@@
-83,7
+83,7
@@
FILE *fmemopen(void *restrict buf, size_t size, const char *restrict mode)
struct mem_FILE *f;
int plus = !!strchr(mode, '+');
- if (!s
ize || !s
trchr("rwa", *mode)) {
+ if (!strchr("rwa", *mode)) {
errno = EINVAL;
return 0;
}