From 163bc6d7fc268bdb1c7cc03699f69d0c5cc0b4cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 15 Jul 2023 09:47:16 +0200 Subject: New upstream version 4.14 --- src/socket.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/socket.c') diff --git a/src/socket.c b/src/socket.c index 9b5d78a..0b6f674 100644 --- a/src/socket.c +++ b/src/socket.c @@ -86,8 +86,11 @@ int HX_addrport_split(const char *spec, char *host, unsigned long hlen = end - spec; if (hlen >= hbufsz) return -E2BIG; - if (*++end == '\0') + if (*++end == '\0') { + memmove(host, spec, hlen); + host[hlen] = '\0'; return 1; + } if (*end++ != ':') return -EINVAL; char *nend = nullptr; @@ -146,6 +149,8 @@ int HX_inet_connect(const char *host, uint16_t port, unsigned int oflags) struct addrinfo *aires = nullptr; int ret = HX_inet_lookup(host, port, AI_ADDRCONFIG, &aires); int saved_errno = 0; + if (ret != 0) + ; for (const struct addrinfo *r = aires; r != nullptr; r = r->ai_next) { int fd = socket(r->ai_family, r->ai_socktype, r->ai_protocol); if (fd < 0) { -- cgit v1.2.3