diff options
Diffstat (limited to 'lib/libc/db/recno/rec_utils.c')
-rw-r--r-- | lib/libc/db/recno/rec_utils.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/libc/db/recno/rec_utils.c b/lib/libc/db/recno/rec_utils.c index 7e1f44be38f..488531ea49f 100644 --- a/lib/libc/db/recno/rec_utils.c +++ b/lib/libc/db/recno/rec_utils.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rec_utils.c,v 1.7 2005/08/05 13:03:00 espie Exp $ */ +/* $OpenBSD: rec_utils.c,v 1.8 2007/08/07 05:40:34 ray Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. @@ -46,7 +46,7 @@ * e: key/data pair to be returned * nrec: record number * key: user's key structure - * data: user's data structure + * data: user's data structure * * Returns: * RET_SUCCESS, RET_ERROR. @@ -62,9 +62,7 @@ __rec_ret(BTREE *t, EPG *e, recno_t nrec, DBT *key, DBT *data) /* We have to copy the key, it's not on the page. */ if (sizeof(recno_t) > t->bt_rkey.size) { - p = (void *)(t->bt_rkey.data == NULL ? - malloc(sizeof(recno_t)) : - realloc(t->bt_rkey.data, sizeof(recno_t))); + p = realloc(t->bt_rkey.data, sizeof(recno_t)); if (p == NULL) return (RET_ERROR); t->bt_rkey.data = p; @@ -92,9 +90,7 @@ dataonly: } else if (F_ISSET(t, B_DB_LOCK)) { /* Use +1 in case the first record retrieved is 0 length. */ if (rl->dsize + 1 > t->bt_rdata.size) { - p = (void *)(t->bt_rdata.data == NULL ? - malloc(rl->dsize + 1) : - realloc(t->bt_rdata.data, rl->dsize + 1)); + p = realloc(t->bt_rdata.data, rl->dsize + 1); if (p == NULL) return (RET_ERROR); t->bt_rdata.data = p; |