diff options
author | 2015-01-16 16:48:51 +0000 | |
---|---|---|
committer | 2015-01-16 16:48:51 +0000 | |
commit | aea60bee5e9bad0aab62f480f19c2fb34c068de4 (patch) | |
tree | 1e7befbc10e28796528939427d4fdbd94b60d9af /lib/libc/db/btree/bt_overflow.c | |
parent | More evil bootstrap code. #ifndef ALIGNBYTES #define ALIGNBYTES 3. (diff) | |
download | wireguard-openbsd-aea60bee5e9bad0aab62f480f19c2fb34c068de4.tar.xz wireguard-openbsd-aea60bee5e9bad0aab62f480f19c2fb34c068de4.zip |
Move to the <limits.h> universe.
review by millert, binary checking process with doug, concept with guenther
Diffstat (limited to 'lib/libc/db/btree/bt_overflow.c')
-rw-r--r-- | lib/libc/db/btree/bt_overflow.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libc/db/btree/bt_overflow.c b/lib/libc/db/btree/bt_overflow.c index c9c411f97cf..2a92b075854 100644 --- a/lib/libc/db/btree/bt_overflow.c +++ b/lib/libc/db/btree/bt_overflow.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bt_overflow.c,v 1.10 2007/08/08 23:57:19 ray Exp $ */ +/* $OpenBSD: bt_overflow.c,v 1.11 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -32,8 +32,6 @@ * SUCH DAMAGE. */ -#include <sys/param.h> - #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -41,6 +39,8 @@ #include <db.h> #include "btree.h" +#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) + /* * Big key/data code. * @@ -105,7 +105,7 @@ __ovfl_get(BTREE *t, void *p, size_t *ssz, void **buf, size_t *bufsz) if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL) return (RET_ERROR); - nb = MIN(sz, plen); + nb = MINIMUM(sz, plen); memmove(p, (char *)h + BTDATAOFF, nb); mpool_put(t->bt_mp, h, 0); @@ -150,7 +150,7 @@ __ovfl_put(BTREE *t, const DBT *dbt, pgno_t *pg) h->flags = P_OVERFLOW; h->lower = h->upper = 0; - nb = MIN(sz, plen); + nb = MINIMUM(sz, plen); memmove((char *)h + BTDATAOFF, p, nb); if (last) { |