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 */