From c7f37efb50eb89ece75ef37b3176254e55419be4 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Mon, 8 Apr 1996 22:01:05 +0000 Subject: [PATCH] use integer flag for init --- src/cache_cf.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/cache_cf.cc b/src/cache_cf.cc index c7ea22d5cb..d954f9aa68 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,4 +1,4 @@ -/* $Id: cache_cf.cc,v 1.20 1996/04/06 00:53:03 wessels Exp $ */ +/* $Id: cache_cf.cc,v 1.21 1996/04/08 16:01:05 wessels Exp $ */ /* DEBUG: Section 3 cache_cf: Configuration file parsing */ @@ -181,16 +181,19 @@ ip_access_type ip_access_check(address, list) struct in_addr address; ip_acl *list; { - static struct in_addr localhost = - {}; /* Initialized to all zero */ + static int init = 0; + static struct in_addr localhost; ip_acl *p = NULL; struct in_addr naddr; /* network byte-order IP addr */ if (!list) return IP_ALLOW; - if (!localhost.s_addr) + if (!init) { + memset((char *) &localhost, '\0', sizeof(struct in_addr)); localhost.s_addr = inet_addr("127.0.0.1"); + init = 1; + } naddr.s_addr = address.s_addr; if (naddr.s_addr == localhost.s_addr) -- 2.47.3