char * escaped = (char *)calloc(1, ((strlen(keywords)*3) + 1));
char * escaped = typecallocn(char, (strlen(keywords)*3) + 1);
PUBLIC BOOL HTSearch ARGS2(	CONST char *,		keywords,	HTParentAnchor *,	here){#define acceptable \"1234567890abcdefghijlkmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-_"    char *q, *u;    CONST char * p, *s, *e;		/* Pointers into keywords */    char * address = NULL;    BOOL result;    char * escaped = (char *)calloc(1, ((strlen(keywords)*3) + 1));    static CONST BOOL isAcceptable[96] =    /*	 0 1 2 3 4 5 6 7 8 9 A B C D E F */    {	 0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,0,	/* 2x	!"#$%&'()*+,-./  */	 1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,	/* 3x  0123456789:;<=>?  */	 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,	/* 4x  @ABCDEFGHIJKLMNO  */	 1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,	/* 5X  PQRSTUVWXYZ[\]^_  */	 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,	/* 6x  `abcdefghijklmno  */	 1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0 };	/* 7X  pqrstuvwxyz{\}~	DEL */    if (escaped == NULL)	outofmem(__FILE__, "HTSearch");    StrAllocCopy(address, here->isIndexAction);    /*    **	Convert spaces to + and hex escape unacceptable characters.    */    for (s = keywords; *s && WHITE(*s); s++)		 /* Scan */	;	/* Skip white space */    for (e = s + strlen(s); e > s && WHITE(*(e-1)); e--) /* Scan */	;	/* Skip trailers */    for (q = escaped, p = s; p < e; p++) {	/* Scan stripped field */	unsigned char c = (unsigned char)TOASCII(*p);	if (WHITE(*p)) {	    *q++ = '+';	} else if (HTCJK != NOCJK) {	    *q++ = *p;	} else if (c>=32 && c<=(unsigned char)127 && isAcceptable[c-32]) {	    *q++ = *p;				/* 930706 TBL for MVS bug */	} else {	    *q++ = '%';	    *q++ = hex((int)(c >> 4));	    *q++ = hex((int)(c & 15));	}    }				/* Loop over string */    *q = '\0';			/* Terminate escaped string */    u = strchr(address, '?');	/* Find old search string */    if (u != NULL)	*u = '\0';		/* Chop old search off */    StrAllocCat(address, "?");    StrAllocCat(address, escaped);    FREE(escaped);    result = HTLoadRelative(address, here);    FREE(address);    /*    **	If we got redirection, result will be NO, but use_this_url_instead    **	will be set.  The calling routine should check both and do whatever    **	is appropriate.  Only an http server (not a gopher or wais server)    **	could return redirection.  Lynx will go all the way back to its    **	mainloop() and subject a redirecting URL to all of its security and    **	restrictions checks. - FM    */    return result;}