diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-10-08 05:28:20 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-10-08 05:28:20 +0000 |
commit | 62aa42aabbbae99712326811e9522577486b3466 (patch) | |
tree | 01f72f5b78f651f032c573409673f54b21f9574e /lib/libc | |
parent | 168fea42afe7bcc04ae7156d0842ccb475a3cfca (diff) |
obvious reallocarray(); ok doug
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)); |