diff options
author | Rich Felker <dalias@aerifal.cx> | 2019-06-25 17:47:12 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2019-06-25 17:47:12 -0400 |
commit | 95dfa3dd12108f42b23a1083e7b32266246a3590 (patch) | |
tree | c67a8bdd122491008d5b84d1037d941c033c39e6 /src | |
parent | a48ccc159a5fa061a18419296100ee48a1cd6cc9 (diff) | |
download | musl-95dfa3dd12108f42b23a1083e7b32266246a3590.tar.gz musl-95dfa3dd12108f42b23a1083e7b32266246a3590.tar.xz musl-95dfa3dd12108f42b23a1083e7b32266246a3590.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/stdio/fmemopen.c | 2 |
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; } |