diff options
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/stdio/open_wmemstream.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdio/open_wmemstream.c b/lib/libc/stdio/open_wmemstream.c index 94141878fdd..391a944456f 100644 --- a/lib/libc/stdio/open_wmemstream.c +++ b/lib/libc/stdio/open_wmemstream.c @@ -1,4 +1,4 @@ -/* $OpenBSD: open_wmemstream.c,v 1.3 2014/03/06 07:28:21 gerhard Exp $ */ +/* $OpenBSD: open_wmemstream.c,v 1.4 2014/10/08 05:28:19 deraadt Exp $ */ /* * Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org> @@ -52,7 +52,7 @@ wmemstream_write(void *v, const char *b, int l) if (sz < end + 1) sz = end + 1; - p = realloc(st->string, sz * sizeof(wchar_t)); + p = reallocarray(st->string, sz, sizeof(wchar_t)); if (!p) return (-1); bzero(p + st->size, (sz - st->size) * sizeof(wchar_t)); |