musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/stdio/fmemopen.c
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 /src/stdio/fmemopen.c
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.
Diffstat (limited to 'src/stdio/fmemopen.c')
-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;
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年10月04日 18:32:22 +0000

AltStyle によって変換されたページ (->オリジナル) /