if ((XParseColor(screen->display,cmap,name,&def))&& (XAllocColor(screen->display,cmap,&def))) { SET_COLOR_VALUE(pNew,ndx,def.pixel); newName= XtMalloc(strlen(name)+1); if (newName) { strcpy(newName,name); SET_COLOR_NAME(pNew,ndx,newName); }
if (XParseColor(screen->display, cmap, name, &def) && XAllocColor(screen->display, cmap, &def) && (newName = XtMalloc(strlen(name)+1)) != 0) { SET_COLOR_VALUE(pNew, ndx, def.pixel); strcpy(newName, name); SET_COLOR_NAME(pNew, ndx, newName); TRACE(("AllocateColor #%d: %s (pixel %#lx)\n", ndx, newName, def.pixel));
AllocateColor(	XtermWidget	 pTerm,	ScrnColors	*pNew,	int		 ndx,	char		*name){XColor			 def;register TScreen	*screen=	&pTerm->screen;Colormap		 cmap=		pTerm->core.colormap;char			*newName;    if ((XParseColor(screen->display,cmap,name,&def))&&	(XAllocColor(screen->display,cmap,&def))) {	SET_COLOR_VALUE(pNew,ndx,def.pixel);	newName= XtMalloc(strlen(name)+1);	if (newName) {	    strcpy(newName,name);	    SET_COLOR_NAME(pNew,ndx,newName);	}	return(TRUE);    }    return(FALSE);}