diff options
author | gibbs <gibbs@FreeBSD.org> | 1998-05-12 03:55:25 +0000 |
---|---|---|
committer | gibbs <gibbs@FreeBSD.org> | 1998-05-12 03:55:25 +0000 |
commit | e808ec6c240ba5d862451966eae5f7568191167b (patch) | |
tree | bce4c36ec46153c04aaa13c104d08933720b442c /sys | |
parent | 0e5c83ad6bdb556ebeee83b65c9d3ebf2fbadc9e (diff) | |
download | FreeBSD-src-e808ec6c240ba5d862451966eae5f7568191167b.zip FreeBSD-src-e808ec6c240ba5d862451966eae5f7568191167b.tar.gz |
Fix the termination test in CIRCLEQ_FOREACH.
Prompted by: Julian Assange <proff@iq.org>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/sys/queue.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/sys/queue.h b/sys/sys/queue.h index 5daaa53..2277087 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)queue.h 8.5 (Berkeley) 8/20/94 - * $Id: queue.h,v 1.19 1997/11/02 19:41:16 gibbs Exp $ + * $Id: queue.h,v 1.20 1998/02/24 17:27:23 julian Exp $ */ #ifndef _SYS_QUEUE_H_ @@ -396,7 +396,9 @@ struct { \ #define CIRCLEQ_FIRST(head) ((head)->cqh_first) #define CIRCLEQ_FOREACH(var, head, field) \ - for((var) = (head)->cqh_first; (var); (var) = (var)->field.cqe_next) + for((var) = (head)->cqh_first; \ + (var) != (void *)(head); \ + (var) = (var)->field.cqe_next) #define CIRCLEQ_INIT(head) do { \ (head)->cqh_first = (void *)(head); \ |