summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2008-10-01 20:22:47 +0000
committermillert <millert@openbsd.org>2008-10-01 20:22:47 +0000
commite68688f2624526175d81c93485bc20faf2ee24ec (patch)
tree4033ff59b3e1bdbfdce6831394e1fecf97b995cd /lib/libc
parentIn uvm_pglistalloc(), do not fall through the success code if we could not find (diff)
downloadwireguard-openbsd-e68688f2624526175d81c93485bc20faf2ee24ec.tar.xz
wireguard-openbsd-e68688f2624526175d81c93485bc20faf2ee24ec.zip
Simplify the loop used for bp overflow detection to match what I'm
using on the list server.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/db/hash/hash_buf.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/libc/db/hash/hash_buf.c b/lib/libc/db/hash/hash_buf.c
index 0b864af82e3..9e857f540bc 100644
--- a/lib/libc/db/hash/hash_buf.c
+++ b/lib/libc/db/hash/hash_buf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hash_buf.c,v 1.17 2008/10/01 19:56:57 millert Exp $ */
+/* $OpenBSD: hash_buf.c,v 1.18 2008/10/01 20:22:47 millert Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -170,17 +170,14 @@ newbuf(HTAB *hashp, u_int32_t addr, BUFHEAD *prev_bp)
}
/* If prev_bp is part of bp overflow, create a new buffer. */
- if (hashp->nbufs == 0 && (prev_bp && bp->ovfl)) {
- BUFHEAD *ovfl_head, *ovfl_next;
+ if (hashp->nbufs == 0 && prev_bp && bp->ovfl) {
+ BUFHEAD *ovfl;
- ovfl_head = bp->ovfl;
- ovfl_next = ovfl_head;
- while (ovfl_next) {
- if (ovfl_next == prev_bp) {
+ for (ovfl = bp->ovfl; ovfl ; ovfl = ovfl->ovfl) {
+ if (ovfl == prev_bp) {
hashp->nbufs++;
break;
}
- ovfl_next = ovfl_next->ovfl;
}
}