Skip to content

Commit

Permalink
Fix: libhbmgmtclient: Correctly handle port if it's not explicitly sp…
Browse files Browse the repository at this point in the history
…ecified when logging in
  • Loading branch information
gao-yan committed Mar 16, 2016
1 parent 1a903a1 commit 236fee1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/mgmt/mgmt_client_lib.c
Expand Up @@ -71,7 +71,9 @@ mgmt_connect(const char* server, const char* user
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = inet_addr(server);
if (port == NULL || !STRNCMP_CONST(port,"None")) {
if (port == NULL
|| strlen(port) == 0
|| !STRNCMP_CONST(port,"None")) {
addr.sin_port = htons(PORT);
}
else {
Expand Down

0 comments on commit 236fee1

Please sign in to comment.