tsocket: Pass the full port number to getaddrinfo().
authorAndreas Schneider <asn@samba.org>
Mon, 1 Jul 2013 15:05:33 +0000 (17:05 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 1 Jul 2013 19:10:53 +0000 (21:10 +0200)
The code stripped port numbers above 9999 down to 4 digits.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jul  1 21:10:53 CEST 2013 on sn-devel-104

lib/tsocket/tsocket_bsd.c

index 4417f8e0454a85b8feba8088f34525ec8d790d6b..fe39dfd5406474c6dbf1f5f12b32c1ec90d8e346 100644 (file)
@@ -389,7 +389,7 @@ int _tsocket_address_inet_from_strings(TALLOC_CTX *mem_ctx,
                return -1;
        }
 
-       snprintf(port_str, sizeof(port_str) - 1, "%u", port);
+       snprintf(port_str, sizeof(port_str), "%u", port);
 
        ret = getaddrinfo(addr, port_str, &hints, &result);
        if (ret != 0) {