summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2019-06-25 17:47:12 -0400
committerRich Felker <dalias@aerifal.cx>2019-06-25 17:47:12 -0400
commit95dfa3dd12108f42b23a1083e7b32266246a3590 (patch)
treec67a8bdd122491008d5b84d1037d941c033c39e6
parenta48ccc159a5fa061a18419296100ee48a1cd6cc9 (diff)
downloadmusl-95dfa3dd12108f42b23a1083e7b32266246a3590.tar.gz
allow fmemopen with zero size
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.
-rw-r--r--src/stdio/fmemopen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stdio/fmemopen.c b/src/stdio/fmemopen.c
index 82413b2d..5685092e 100644
--- 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 (!size || !strchr("rwa", *mode)) {
+ if (!strchr("rwa", *mode)) {
errno = EINVAL;
return 0;
}