From 03dcaff4477e78f98c6117774d1608809c0ab088 Mon Sep 17 00:00:00 2001 From: Ryan Thomas McBride Date: Sat, 23 Nov 2002 08:12:57 +0000 Subject: check to make sure a list item exists before checking to see if the next one is there. ok dhartmei@ --- sbin/pfctl/pfctl_parser.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sbin') diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 62b7cb85fd2..288fe535685 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_parser.c,v 1.107 2002/11/23 06:18:42 mcbride Exp $ */ +/* $OpenBSD: pfctl_parser.c,v 1.108 2002/11/23 08:12:56 mcbride Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -400,7 +400,8 @@ print_pool(struct pf_pool *pool, sa_family_t af, int id) { struct pf_pooladdr *pooladdr; - if (TAILQ_NEXT(TAILQ_FIRST(&pool->list), entries) != NULL) + if ((TAILQ_FIRST(&pool->list) != NULL) && + TAILQ_NEXT(TAILQ_FIRST(&pool->list), entries) != NULL) printf("{ "); TAILQ_FOREACH(pooladdr, &pool->list, entries){ switch (id) { -- cgit v1.2.3