summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2008-10-01 20:22:48 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2008-10-01 20:22:48 +0000
commit6b5dc4ed53339689f73190dc26aa21a78f44e0fc (patch)
tree6eca94356389faf533d252c504c66eaf8276ff00 /lib
parentbf636e917f80daabe6d203326330f45d2a5f9d46 (diff)
Simplify the loop used for bp overflow detection to match what I'm
using on the list server.
Diffstat (limited to 'lib')
-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;
}
}