fix zero-terminated host and port in connect call