1
0
mirror of https://github.com/janet-lang/janet synced 2024-12-27 17:00:27 +00:00

Fix incorrect error when argv[3] is null

The `janet_get_addrinfo` function retained code that was meant for
compliance with 3 separate function signatures under a single function
name. Changing things to be a single function signature was broken until
the code pertaining to the aforementioned was stripped out.
This commit is contained in:
llmII 2021-09-07 16:11:37 -05:00
parent 7446802a70
commit 7d2bf334c8
No known key found for this signature in database
GPG Key ID: E3AD2E259F58A9A0

View File

@ -301,12 +301,7 @@ static struct addrinfo *janet_get_addrinfo(Janet *argv, int32_t offset, int sock
/* when is_bind is set, we're performing a connect, but wanting to
* specify from where we connect, and in general don't care about a
* port */
/* TODO: remove check, argv[3] is where our bindhost is at! */
int32_t current_offset = 2;
if (janet_checktype(argv[current_offset], JANET_KEYWORD)) {
current_offset++;
}
host = (char *)janet_getcstring(argv, current_offset);
host = (char *)janet_getcstring(argv, 3);
port = NULL;
err = "could not get address info for connect bind: %s";
}