diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-10-07 15:10:20 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-01-10 09:53:31 +0100 |
commit | c40e45b75eb76d79a05c7fa85c1fa9b5c728a12f (patch) | |
tree | ad4f2519067709f00ab98b3c591186c26dc3a21f /freebsd/lib/libc/db/recno/rec_put.c | |
parent | userspace-header-gen.py: Simplify program ports (diff) | |
download | rtems-libbsd-c40e45b75eb76d79a05c7fa85c1fa9b5c728a12f.tar.bz2 |
Update to FreeBSD head 2016-08-23
Git mirror commit 9fe7c416e6abb28b1398fd3e5687099846800cfd.
Diffstat (limited to 'freebsd/lib/libc/db/recno/rec_put.c')
-rw-r--r-- | freebsd/lib/libc/db/recno/rec_put.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/freebsd/lib/libc/db/recno/rec_put.c b/freebsd/lib/libc/db/recno/rec_put.c index a667022e..f8253aa7 100644 --- a/freebsd/lib/libc/db/recno/rec_put.c +++ b/freebsd/lib/libc/db/recno/rec_put.c @@ -142,8 +142,7 @@ einval: errno = EINVAL; return (RET_ERROR); if (nrec > t->bt_nrecs + 1) { if (F_ISSET(t, R_FIXLEN)) { - if ((tdata.data = - (void *)malloc(t->bt_reclen)) == NULL) + if ((tdata.data = malloc(t->bt_reclen)) == NULL) return (RET_ERROR); tdata.size = t->bt_reclen; memset(tdata.data, t->bt_bval, tdata.size); @@ -210,7 +209,7 @@ __rec_iput(BTREE *t, recno_t nrec, const DBT *data, u_int flags) return (RET_ERROR); tdata.data = db; tdata.size = NOVFLSIZE; - *(pgno_t *)db = pg; + memcpy(db, &pg, sizeof(pg)); *(u_int32_t *)(db + sizeof(pgno_t)) = data->size; dflags = P_BIGDATA; data = &tdata; |