summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCore/Stream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibCore/Stream.cpp')
-rw-r--r--Userland/Libraries/LibCore/Stream.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Libraries/LibCore/Stream.cpp b/Userland/Libraries/LibCore/Stream.cpp
index 2b497a520d..c1d25ae29f 100644
--- a/Userland/Libraries/LibCore/Stream.cpp
+++ b/Userland/Libraries/LibCore/Stream.cpp
@@ -336,7 +336,8 @@ ErrorOr<IPv4Address> Socket::resolve_host(String const& host, SocketType type)
return Error::from_syscall("getaddrinfo", -errno);
}
- return Error::from_string_literal(gai_strerror(rc));
+ auto const* error_string = gai_strerror(rc);
+ return Error::from_string_view({ error_string, strlen(error_string) });
}
auto* socket_address = bit_cast<struct sockaddr_in*>(results->ai_addr);