X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fstdio%2Ffmemopen.c;h=5685092e36018247bb7308bbce5db18416b8b3f9;hb=97d35a552ec5b6ddf7923dd2f9a8eb973526acea;hp=5e0eeb50d44865398f90f39cf5416282d3b8b0fe;hpb=f66022dda8d18e6732626c7806f6c4d32023d574;p=musl diff --git a/src/stdio/fmemopen.c b/src/stdio/fmemopen.c index 5e0eeb50..5685092e 100644 --- a/src/stdio/fmemopen.c +++ b/src/stdio/fmemopen.c @@ -1,7 +1,9 @@ #include "stdio_impl.h" #include #include +#include #include +#include "libc.h" struct cookie { size_t pos, len, size; @@ -81,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; }