endp = __stpcpy (__stpcpy (endp, "."), type);
endp = stpcpy (stpcpy (endp, "."), type);
char *hesiod_to_bind(void *context, const char *name, const char *type){  struct hesiod_p *ctx = (struct hesiod_p *) context;  char bindname[MAXDNAME], *p, *endp, *ret, **rhs_list = NULL;  const char *rhs;  size_t len;  endp = stpcpy(bindname, name);  /* Find the right right hand side to use, possibly truncating bindname. */  p = strchr(bindname, '@');  if (p)    {      *p++ = 0;      if (strchr(p, '.'))	rhs = name + (p - bindname);      else	{	  rhs_list = hesiod_resolve(context, p, "rhs-extension");	  if (rhs_list)	    rhs = *rhs_list;	  else	    {	      __set_errno (ENOENT);	      return NULL;	    }	}    } else      rhs = ctx->rhs;  /* See if we have enough room. */  len = (endp - bindname) + 1 + strlen(type);  if (ctx->lhs)    len += strlen(ctx->lhs) + ((ctx->lhs[0] != '.') ? 1 : 0);  len += strlen(rhs) + ((rhs[0] != '.') ? 1 : 0);  if (len > sizeof(bindname) - 1)    {      if (rhs_list)	hesiod_free_list(context, rhs_list);      __set_errno (EMSGSIZE);      return NULL;    }  /* Put together the rest of the domain. */  endp = __stpcpy (__stpcpy (endp, "."), type);  if (ctx->lhs)    {      if (ctx->lhs[0] != '.')	endp = __stpcpy (endp, ".");      endp = __stpcpy (endp, ctx->lhs);    }  if (rhs[0] != '.')    endp = __stpcpy (endp, ".");  endp = __stpcpy (endp, rhs);  /* rhs_list is no longer needed, since we're done with rhs. */  if (rhs_list)    hesiod_free_list(context, rhs_list);  /* Make a copy of the result and return it to the caller. */  ret = malloc((endp - bindname) + 1);  if (!ret)    {      __set_errno (ENOMEM);      return NULL;    }  strcpy(ret, bindname);  return ret;}