q = (char *)calloc(1, (strlen(*str) + (4 * amps) + (3 * lts) + (3 * gts) + 1));
q = typecallocn(char, (strlen(*str) + (4 * amps) + (3 * lts) + (3 * gts) + 1));
PUBLIC void LYEntify ARGS2(	char **,	str,	BOOLEAN,	isTITLE){    char *p = *str;    char *q = NULL, *cp = NULL;    int amps = 0, lts = 0, gts = 0;    if (p == NULL || *p == '\0')	return;    /*     *	Count the ampersands. - FM     */    while ((*p != '\0') && (q = strchr(p, '&')) != NULL) {	amps++;	p = (q + 1);    }    /*     *	Count the left-angle-brackets, if needed. - FM     */    if (isTITLE == TRUE) {	p = *str;	while ((*p != '\0') && (q = strchr(p, '<')) != NULL) {	    lts++;	    p = (q + 1);	}    }    /*     *	Count the right-angle-brackets, if needed. - FM     */    if (isTITLE == TRUE) {	p = *str;	while ((*p != '\0') && (q = strchr(p, '>')) != NULL) {	    gts++;	    p = (q + 1);	}    }    /*     *	Check whether we need to convert anything. - FM     */    if (amps == 0 && lts == 0 && gts == 0)	return;    /*     *	Allocate space and convert. - FM     */    q = (char *)calloc(1,		     (strlen(*str) + (4 * amps) + (3 * lts) + (3 * gts) + 1));    if ((cp = q) == NULL)	outofmem(__FILE__, "LYEntify");    for (p = *str; *p; p++) {	if (*p == '&') {	    *q++ = '&';	    *q++ = 'a';	    *q++ = 'm';	    *q++ = 'p';	    *q++ = ';';	} else if (isTITLE && *p == '<') {	    *q++ = '&';	    *q++ = 'l';	    *q++ = 't';	    *q++ = ';';	} else if (isTITLE && *p == '>') {	    *q++ = '&';	    *q++ = 'g';	    *q++ = 't';	    *q++ = ';';	} else {	    *q++ = *p;	}    }    StrAllocCopy(*str, cp);    FREE(cp);}