From 70232307a66f4261fa017b80c1cf46e555cbeb46 Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Thu, 20 Aug 2015 21:49:29 +0000 Subject: [PATCH] All these files include , so do not need to cast malloc/calloc/realloc* returns. --- src/lib/libc/stdlib/ecvt.c | 6 +++--- src/lib/libc/stdlib/tsearch.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/libc/stdlib/ecvt.c b/src/lib/libc/stdlib/ecvt.c index 4562e309..a0bbbec0 100644 --- a/src/lib/libc/stdlib/ecvt.c +++ b/src/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 @@ -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/src/lib/libc/stdlib/tsearch.c b/src/lib/libc/stdlib/tsearch.c index a141085d..6a525e8b 100644 --- a/src/lib/libc/stdlib/tsearch.c +++ b/src/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 */