$NetBSD: patch-ag,v 1.4 2025/04/29 14:18:00 tnn Exp $ --- hosts_access.c.orig 2003-12-25 00:49:56.000000000 +0000 +++ hosts_access.c @@ -33,9 +33,7 @@ static char sccsid[] = "@(#) hosts_acces #include #include #include - -extern char *fgets(); -extern int errno; +#include #ifndef INADDR_NONE #define INADDR_NONE (-1) /* XXX should be 0xffffffff */ @@ -75,13 +73,13 @@ int resident = (-1); /* -1, 0: unkn /* Forward declarations. */ -static int table_match(); -static int list_match(); -static int server_match(); -static int client_match(); -static int host_match(); -static int string_match(); -static int masked_match(); +static int table_match(char*, struct request_info *); +static int list_match(char *, struct request_info *, int (*)(char *, struct request_info *)); +static int server_match(char *, struct request_info *); +static int client_match(char *, struct request_info *); +static int host_match(char *, struct host_info *); +static int string_match(char *, char *); +static int masked_match(char *, char *, char *); #ifdef HAVE_IPV6 static void ipv6_mask(); #endif @@ -188,7 +186,7 @@ struct request_info *request; static int list_match(list, request, match_fn) char *list; struct request_info *request; -int (*match_fn) (); +int (*match_fn)(char *, struct request_info *); { char *tok; @@ -405,7 +403,7 @@ static void ipv6_mask(in6p, maskbits) struct in6_addr *in6p; int maskbits; { - uchar_t *p = (uchar_t*) in6p; + unsigned char *p = (unsigned char *) in6p; if (maskbits < 0 || maskbits >= IPV6_ABITS) return; @@ -416,7 +414,7 @@ int maskbits; if (maskbits != 0) *p++ &= 0xff << (8 - maskbits); - while (p < (((uchar_t*) in6p)) + sizeof(*in6p)) + while (p < (((unsigned char *) in6p)) + sizeof(*in6p)) *p++ = 0; } #endif