add: buf[sizeof(buf) - 1] = '\0';
context: parse_hostnetworkmask(const char *name, struct in_addr **addrpp,		      struct in_addr *maskp, unsigned int *naddrs){	struct in_addr *addrp;	char buf[256];	char *p;	int i, j, k, n;	strncpy(buf, name, sizeof(buf) - 1);	if ((p = strrchr(buf, '/')) != NULL) {		*p = '\0';		addrp = parse_mask(p + 1);	} else		addrp = parse_mask(NULL);	inaddrcpy(maskp, addrp);	/* if a null mask is given, the name is ignored, like in "any/0" */	if (maskp->s_addr == 0L)		strcpy(buf, "0.0.0.0");	addrp = *addrpp = parse_hostnetwork(buf, naddrs);	n = *naddrs;	for (i = 0, j = 0; i < n; i++) {		addrp[j++].s_addr &= maskp->s_addr;		for (k = 0; k < j - 1; k++) {			if (addrp[k].s_addr == addrp[j - 1].s_addr) {				(*naddrs)--;				j--;				break;			}		}	}}