Skip to content

Util::init_host_name: Fix selecting the hostname when the specified endpoint is an ip address

The code block starting with if(ind != -1) is currently never executed as ind is only ever set to something not equal -1 in the if block above. But that if block then immediately breaks out of the for lopp.

The comment in the function states

// If it is specified as a IP address, search for this IP in ip_list vector and select this name in the result // of getnameinfo() call

so the author believes that this is a bug.

Place the braces correctly to fix it.

Close #1081 (closed)

Merge request reports