summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/open_wmemstream.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdio/open_wmemstream.c')
-rw-r--r--lib/libc/stdio/open_wmemstream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/stdio/open_wmemstream.c b/lib/libc/stdio/open_wmemstream.c
index 3e8713f..d3331aa 100644
--- a/lib/libc/stdio/open_wmemstream.c
+++ b/lib/libc/stdio/open_wmemstream.c
@@ -63,7 +63,7 @@ wmemstream_grow(struct wmemstream *ms, fpos_t newoff)
else
newsize = newoff;
if (newsize > ms->len) {
- buf = realloc(*ms->bufp, (newsize + 1) * sizeof(wchar_t));
+ buf = reallocarray(*ms->bufp, newsize + 1, sizeof(wchar_t));
if (buf != NULL) {
#ifdef DEBUG
fprintf(stderr, "WMS: %p growing from %zd to %zd\n",
OpenPOWER on IntegriCloud