dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr) const char *exp_dn; u_char *comp_dn, **dnptrs, **lastdnptr; int length;
dn_comp(src, dst, dstsiz, dnptrs, lastdnptr) const char *src; u_char *dst; int dstsiz; u_char **dnptrs; u_char **lastdnptr;
dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr)	const char *exp_dn;	u_char *comp_dn, **dnptrs, **lastdnptr;	int length;{	register u_char *cp, *dn;	register int c, l;	u_char **cpp, **lpp, *sp, *eob;	u_char *msg;	dn = (u_char *)exp_dn;	cp = comp_dn;	if (length > MAXCDNAME)		length = MAXCDNAME;	eob = cp + length;	lpp = cpp = NULL;	if (dnptrs != NULL) {		if ((msg = *dnptrs++) != NULL) {			for (cpp = dnptrs; *cpp != NULL; cpp++)				;			lpp = cpp;	/* end of list to search */		}	} else		msg = NULL;	for (c = *dn++; c != '\0'; ) {		/* look to see if we can use pointers */		if (msg != NULL) {			if ((l = dn_find(dn-1, msg, dnptrs, lpp)) >= 0) {				if (cp+1 >= eob)					return (-1);				*cp++ = (l >> 8) | INDIR_MASK;				*cp++ = l % 256;				return (cp - comp_dn);			}			/* not found, save it */			if (lastdnptr != NULL && cpp < lastdnptr-1) {				*cpp++ = cp;				*cpp = NULL;			}		}		sp = cp++;	/* save ptr to length byte */		do {			if (c == '.') {				c = *dn++;				break;			}			if (c == '\\') {				if ((c = *dn++) == '\0')					break;			}			if (cp >= eob) {				if (msg != NULL)					*lpp = NULL;				return (-1);			}			*cp++ = c;		} while ((c = *dn++) != '\0');		/* catch trailing '.'s but not '..' */		if ((l = cp - sp - 1) == 0 && c == '\0') {			cp--;			break;		}		if (l <= 0 || l > MAXLABEL) {			if (msg != NULL)				*lpp = NULL;			return (-1);		}		*sp = l;	}	if (cp >= eob) {		if (msg != NULL)			*lpp = NULL;		return (-1);	}	*cp++ = '\0';	return (cp - comp_dn);}