summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib
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/stdlib
parenta2dd9b690f0078a3e6a1fb76a97c846f4c185a06 (diff)
All these files include <stdlib.h>, so do not need to cast
malloc/calloc/realloc* returns.
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r--lib/libc/stdlib/ecvt.c6
-rw-r--r--lib/libc/stdlib/tsearch.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/libc/stdlib/ecvt.c b/lib/libc/stdlib/ecvt.c
index 4562e309e8e..a0bbbec0737 100644
--- a/lib/libc/stdlib/ecvt.c
+++ b/lib/libc/stdlib/ecvt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ecvt.c,v 1.8 2013/11/01 19:05:11 guenther Exp $ */
+/* $OpenBSD: ecvt.c,v 1.9 2015/08/20 21:49:29 deraadt Exp $ */
/*
* Copyright (c) 2002, 2006 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -55,7 +55,7 @@ __cvt(double value, int ndigit, int *decpt, int *sign, int fmode, int pad)
if (value == 0.0) {
*decpt = 1 - fmode; /* 1 for 'e', 0 for 'f' */
*sign = 0;
- if ((rve = s = (char *)malloc(siz)) == NULL)
+ if ((rve = s = malloc(siz)) == NULL)
return(NULL);
*rve++ = '0';
*rve = '\0';
@@ -73,7 +73,7 @@ __cvt(double value, int ndigit, int *decpt, int *sign, int fmode, int pad)
/* Make a local copy and adjust rve to be in terms of s */
if (pad && fmode)
siz += *decpt;
- if ((s = (char *)malloc(siz)) == NULL) {
+ if ((s = malloc(siz)) == NULL) {
__freedtoa(p);
return(NULL);
}
diff --git a/lib/libc/stdlib/tsearch.c b/lib/libc/stdlib/tsearch.c
index a141085d2b3..6a525e8bf06 100644
--- a/lib/libc/stdlib/tsearch.c
+++ b/lib/libc/stdlib/tsearch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tsearch.c,v 1.8 2014/03/16 18:38:30 guenther Exp $ */
+/* $OpenBSD: tsearch.c,v 1.9 2015/08/20 21:49:29 deraadt Exp $ */
/*
* Tree search generalized from Knuth (6.2.2) Algorithm T just like
@@ -40,7 +40,7 @@ tsearch(const void *vkey, void **vrootp,
&(*rootp)->left : /* T3: follow left branch */
&(*rootp)->right; /* T4: follow right branch */
}
- q = (node *) malloc(sizeof(node)); /* T5: key not found */
+ q = malloc(sizeof(node)); /* T5: key not found */
if (q != (struct node_t *)0) { /* make new node */
*rootp = q; /* link new node to old */
q->key = key; /* initialize new node */