Merge pull request #1171 from zevv/zevv-net-connect

Fixed net/connect binding address
This commit is contained in:
Calvin Rose 2023-05-30 16:53:24 -05:00 committed by GitHub
commit 9c97d8f648
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -460,7 +460,7 @@ JANET_CORE_FN(cfun_net_connect,
if (binding) {
struct addrinfo *rp = NULL;
int did_bind = 0;
for (rp = ai; rp != NULL; rp = rp->ai_next) {
for (rp = binding; rp != NULL; rp = rp->ai_next) {
if (bind(sock, rp->ai_addr, (int) rp->ai_addrlen) == 0) {
did_bind = 1;
break;