Преглед на файлове

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.
Rich Felker преди 5 години
родител
ревизия
95dfa3dd12
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      src/stdio/fmemopen.c

+ 1 - 1
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;
 	}