X-Git-Url: https://git.distorted.org.uk/~mdw/secnet/blobdiff_plain/423936d35d7671fd017d2d611d418d1b8eeb6195..b073e347cce9f17f137cbd961a36c75b30a22148:/ipaddr.c diff --git a/ipaddr.c b/ipaddr.c index b45afef..9302925 100644 --- a/ipaddr.c +++ b/ipaddr.c @@ -313,18 +313,12 @@ struct subnet_list *ipset_to_subnet_list(struct ipset *is) return r; } -#define IPADDR_NBUFS_SHIFT 4 -#define IPADDR_NBUFS (1 << IPADDR_NBUFS_SHIFT) #define IPADDR_BUFLEN 20 static char *ipaddr_getbuf(void) { - static int b; - static char bufs[IPADDR_NBUFS][IPADDR_BUFLEN]; - - b++; - b &= IPADDR_NBUFS-1; - return bufs[b]; + SBUF_DEFINE(16, IPADDR_BUFLEN); + return SBUF; } /* The string buffer must be at least 16 bytes long */