Browse Source

All these files include <stdlib.h>, so do not need to cast

malloc/calloc/realloc* returns.
OPENBSD_5_9
deraadt 9 years ago
parent
commit
70232307a6
2 changed files with 5 additions and 5 deletions
  1. +3
    -3
      src/lib/libc/stdlib/ecvt.c
  2. +2
    -2
      src/lib/libc/stdlib/tsearch.c

+ 3
- 3
src/lib/libc/stdlib/ecvt.c View File

@ -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> * 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) { if (value == 0.0) {
*decpt = 1 - fmode; /* 1 for 'e', 0 for 'f' */ *decpt = 1 - fmode; /* 1 for 'e', 0 for 'f' */
*sign = 0; *sign = 0;
if ((rve = s = (char *)malloc(siz)) == NULL)
if ((rve = s = malloc(siz)) == NULL)
return(NULL); return(NULL);
*rve++ = '0'; *rve++ = '0';
*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 */ /* Make a local copy and adjust rve to be in terms of s */
if (pad && fmode) if (pad && fmode)
siz += *decpt; siz += *decpt;
if ((s = (char *)malloc(siz)) == NULL) {
if ((s = malloc(siz)) == NULL) {
__freedtoa(p); __freedtoa(p);
return(NULL); return(NULL);
} }


+ 2
- 2
src/lib/libc/stdlib/tsearch.c View File

@ -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 * 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)->left : /* T3: follow left branch */
&(*rootp)->right; /* T4: follow right 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 */ if (q != (struct node_t *)0) { /* make new node */
*rootp = q; /* link new node to old */ *rootp = q; /* link new node to old */
q->key = key; /* initialize new node */ q->key = key; /* initialize new node */


Loading…
Cancel
Save