summaryrefslogtreecommitdiff
path: root/lib/libc/gen
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-08-20 21:49:30 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-08-20 21:49:30 +0000
commitb0f86654d3982ec3e78264e7628718e6ae18e12c (patch)
treef6f1a43aea77a33e57c4446f7a79e32179fccbb7 /lib/libc/gen
parenta2dd9b690f0078a3e6a1fb76a97c846f4c185a06 (diff)
All these files include <stdlib.h>, so do not need to cast
malloc/calloc/realloc* returns.
Diffstat (limited to 'lib/libc/gen')
-rw-r--r--lib/libc/gen/getmntinfo.c4
-rw-r--r--lib/libc/gen/scandir.c6
-rw-r--r--lib/libc/gen/strtofflags.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/libc/gen/getmntinfo.c b/lib/libc/gen/getmntinfo.c
index 6e9dd857cd7..285687e45f4 100644
--- a/lib/libc/gen/getmntinfo.c
+++ b/lib/libc/gen/getmntinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getmntinfo.c,v 1.8 2015/01/16 16:48:51 deraadt Exp $ */
+/* $OpenBSD: getmntinfo.c,v 1.9 2015/08/20 21:49:29 deraadt Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -50,7 +50,7 @@ getmntinfo(struct statfs **mntbufp, int flags)
if (mntbuf)
free(mntbuf);
bufsize = (mntsize + 1) * sizeof(struct statfs);
- if ((mntbuf = (struct statfs *)malloc(bufsize)) == 0) {
+ if ((mntbuf = malloc(bufsize)) == 0) {
bufsize = 0;
return (0);
}
diff --git a/lib/libc/gen/scandir.c b/lib/libc/gen/scandir.c
index 40e9b7a8f21..c364bda6c4f 100644
--- a/lib/libc/gen/scandir.c
+++ b/lib/libc/gen/scandir.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scandir.c,v 1.19 2015/02/05 12:59:57 millert Exp $ */
+/* $OpenBSD: scandir.c,v 1.20 2015/08/20 21:49:29 deraadt Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -82,7 +82,7 @@ scandir(const char *dirname, struct dirent ***namelist,
errno = ENOMEM;
goto fail;
}
- names = (struct dirent **)calloc(arraysz, sizeof(struct dirent *));
+ names = calloc(arraysz, sizeof(struct dirent *));
if (names == NULL)
goto fail;
@@ -114,7 +114,7 @@ scandir(const char *dirname, struct dirent ***namelist,
/*
* Make a minimum size copy of the data
*/
- p = (struct dirent *)malloc(DIRSIZ(d));
+ p = malloc(DIRSIZ(d));
if (p == NULL)
goto fail;
diff --git a/lib/libc/gen/strtofflags.c b/lib/libc/gen/strtofflags.c
index a54fd2ce843..76cc9b7d856 100644
--- a/lib/libc/gen/strtofflags.c
+++ b/lib/libc/gen/strtofflags.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strtofflags.c,v 1.6 2007/09/02 15:19:16 deraadt Exp $ */
+/* $OpenBSD: strtofflags.c,v 1.7 2015/08/20 21:49:29 deraadt Exp $ */
/*-
* Copyright (c) 1993
@@ -82,7 +82,7 @@ fflagstostr(u_int32_t flags)
u_int32_t setflags;
int i;
- if ((string = (char *)calloc(nmappings, longestflaglen + 1)) == NULL)
+ if ((string = calloc(nmappings, longestflaglen + 1)) == NULL)
return (NULL);
setflags = flags;