if (len > sizeof(address) - 1) len = sizeof(address) - 1;
ConnectToPeer (networkIdsList, actualConnectionRet)char *networkIdsList;char **actualConnectionRet;{    char address[256];    char *ptr, *endptr, *delim;    int  madeConnection = 0;    int  len, retry;    int  connect_stat;    XtransConnInfo trans_conn = NULL;    *actualConnectionRet = NULL;    ptr = networkIdsList;    endptr = networkIdsList + strlen (networkIdsList);    while (ptr < endptr && !madeConnection)    {	if ((delim = (char *) strchr (ptr, ',')) == NULL)	    delim = endptr;	len = delim - ptr;	strncpy (address, ptr, len);	address[len] = '\0';	ptr = delim + 1;	for (retry = ICE_CONNECTION_RETRIES; retry >= 0; retry--)	{	    if ((trans_conn = _IceTransOpenCOTSClient (address)) == NULL)	    {		break;	    }	    if ((connect_stat = _IceTransConnect (trans_conn, address)) < 0)	    {		_IceTransClose (trans_conn);		if (connect_stat == TRANS_TRY_CONNECT_AGAIN)		{		    sleep(1);		    continue;		}		else		    break;	    }	    else	    {		madeConnection = 1;		break;	    }	}    }    if (madeConnection)    {	/*	 * We need to return the actual network connection string	 */	*actualConnectionRet = (char *) malloc (strlen (address) + 1);	strcpy (*actualConnectionRet, address);		/*	 * Return the file descriptor	 */	return (trans_conn);    }    else    {	return (NULL);    }}