diff options
author | 2015-08-20 21:49:29 +0000 | |
---|---|---|
committer | 2015-08-20 21:49:29 +0000 | |
commit | fa713987d76a93563f4184563f8d4ffc677f4041 (patch) | |
tree | 318fa02da64cfdb6a0757a26b62181035ee81e85 /lib/libc/stdio | |
parent | remove cast of malloc(), since stdlib.h is included (diff) | |
download | wireguard-openbsd-fa713987d76a93563f4184563f8d4ffc677f4041.tar.xz wireguard-openbsd-fa713987d76a93563f4184563f8d4ffc677f4041.zip |
All these files include <stdlib.h>, so do not need to cast
malloc/calloc/realloc* returns.
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r-- | lib/libc/stdio/asprintf.c | 4 | ||||
-rw-r--r-- | lib/libc/stdio/vasprintf.c | 4 | ||||
-rw-r--r-- | lib/libc/stdio/vswprintf.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/libc/stdio/asprintf.c b/lib/libc/stdio/asprintf.c index 5424c90dc9d..861bb0a797d 100644 --- a/lib/libc/stdio/asprintf.c +++ b/lib/libc/stdio/asprintf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asprintf.c,v 1.19 2011/05/30 18:48:33 martynas Exp $ */ +/* $OpenBSD: asprintf.c,v 1.20 2015/08/20 21:49:29 deraadt Exp $ */ /* * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> @@ -36,7 +36,7 @@ asprintf(char **str, const char *fmt, ...) _FILEEXT_SETUP(&f, &fext); f._file = -1; f._flags = __SWR | __SSTR | __SALC; - f._bf._base = f._p = (unsigned char *)malloc(128); + f._bf._base = f._p = malloc(128); if (f._bf._base == NULL) goto err; f._bf._size = f._w = 127; /* Leave room for the NUL */ diff --git a/lib/libc/stdio/vasprintf.c b/lib/libc/stdio/vasprintf.c index 8fe7c5bb553..2cc3c7d9356 100644 --- a/lib/libc/stdio/vasprintf.c +++ b/lib/libc/stdio/vasprintf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vasprintf.c,v 1.16 2009/11/09 00:18:27 kurt Exp $ */ +/* $OpenBSD: vasprintf.c,v 1.17 2015/08/20 21:49:29 deraadt Exp $ */ /* * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> @@ -33,7 +33,7 @@ vasprintf(char **str, const char *fmt, __va_list ap) _FILEEXT_SETUP(&f, &fext); f._file = -1; f._flags = __SWR | __SSTR | __SALC; - f._bf._base = f._p = (unsigned char *)malloc(128); + f._bf._base = f._p = malloc(128); if (f._bf._base == NULL) goto err; f._bf._size = f._w = 127; /* Leave room for the NUL */ diff --git a/lib/libc/stdio/vswprintf.c b/lib/libc/stdio/vswprintf.c index da7c4deaee0..d79563f5568 100644 --- a/lib/libc/stdio/vswprintf.c +++ b/lib/libc/stdio/vswprintf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vswprintf.c,v 1.4 2012/12/05 23:20:01 deraadt Exp $ */ +/* $OpenBSD: vswprintf.c,v 1.5 2015/08/20 21:49:29 deraadt Exp $ */ /* $NetBSD: vswprintf.c,v 1.1 2005/05/14 23:51:02 christos Exp $ */ /* @@ -55,7 +55,7 @@ vswprintf(wchar_t * __restrict s, size_t n, const wchar_t * __restrict fmt, _FILEEXT_SETUP(&f, &fext); f._file = -1; f._flags = __SWR | __SSTR | __SALC; - f._bf._base = f._p = (unsigned char *)malloc(128); + f._bf._base = f._p = malloc(128); if (f._bf._base == NULL) { errno = ENOMEM; return (-1); |