void toEp(SocketEndpoint & ep, LPCSTR epTxt) { char * tmp = static_cast <char *> (alloca(strlen(epTxt) + 1)); strcpy(tmp, epTxt); for(int i = strlen(tmp); i >= 0; i--) { if(*(tmp + i) == ':') { ep.port = atoi(tmp + i + 1); *(tmp + i) = 0; ep.ipset(tmp); break; } } }