summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 7c193a57..2ce43d32 100644
--- a/src/stdio/fmemopen.c
+++ b/src/stdio/fmemopen.c
@@ -81,7 +81,7 @@ FILE *fmemopen(void *restrict buf, size_t size, const char *restrict mode)
return 0;
}
- if (!buf && size > SIZE_MAX-sizeof(FILE)-BUFSIZ-UNGET) {
+ if (!buf && size > PTRDIFF_MAX) {
errno = ENOMEM;
return 0;
}