summaryrefslogtreecommitdiffstats
path: root/lib/libc/db/btree/bt_overflow.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/db/btree/bt_overflow.c')
-rw-r--r--lib/libc/db/btree/bt_overflow.c10
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) {