From b23dcd101a3fbfe662479ddfe6985bd2b874741f Mon Sep 17 00:00:00 2001 From: Salvador Fandino Date: Tue, 2 Jun 2015 14:55:40 +0200 Subject: merge code paths depending on acceptHost being "" --- nxcomp/Loop.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'nxcomp') diff --git a/nxcomp/Loop.cpp b/nxcomp/Loop.cpp index f051130dd..450c477c6 100644 --- a/nxcomp/Loop.cpp +++ b/nxcomp/Loop.cpp @@ -6629,22 +6629,16 @@ int WaitForRemote(int portNum) goto WaitForRemoteError; } - } - - proxyFD = ListenConnectionTCP( ((loopbackBind || (control->ProxyMode == proxy_server)) ? "localhost" : "*"), - portNum, "NX"); - - if (*acceptHost != '\0') - { - strcat(hostLabel, "'"); - strcat(hostLabel, acceptHost); - strcat(hostLabel, "'"); + strcpy(hostLabel, "any host"); } else { - strcpy(hostLabel, "any host"); + snprintf(hostLabel, sizeof(hostLabel), "'%s'", acceptHost); } + proxyFD = ListenConnectionTCP(((loopbackBind || (control->ProxyMode == proxy_server)) ? "localhost" : "*"), + portNum, "NX"); + #ifdef TEST *logofs << "Loop: Waiting for connection from " << hostLabel << " on port '" << portNum -- cgit v1.2.3