aboutsummaryrefslogtreecommitdiff
path: root/lib/std/net.zig
diff options
context:
space:
mode:
authorRaul Leal <raulgrell@gmail.com>2019-12-17 20:43:49 +0000
committerAndrew Kelley <andrew@ziglang.org>2019-12-17 15:43:49 -0500
commit62c817420df0420e20756b2c3a4ec99db3b5649d (patch)
tree76c11dd168ae2eced1904a1012eb0a54df279eaa /lib/std/net.zig
parentb242c2ac103cbb251751dcf94f665e57b9551156 (diff)
downloadzig-62c817420df0420e20756b2c3a4ec99db3b5649d.tar.gz
zig-62c817420df0420e20756b2c3a4ec99db3b5649d.zip
[#3844 + #3767] update std.c and std.os.linux to use null-terminated pointer types (#3900)
* #3844 update std.c functions to use null-terminated pointer types * check linux functions * fix callsites * fix io test * Add allocPrintCstr function to remove other cast
Diffstat (limited to 'lib/std/net.zig')
-rw-r--r--lib/std/net.zig6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/std/net.zig b/lib/std/net.zig
index 0a98bd999b..53b75d8578 100644
--- a/lib/std/net.zig
+++ b/lib/std/net.zig
@@ -451,7 +451,11 @@ pub fn getAddressList(allocator: *mem.Allocator, name: []const u8, port: u16) !*
.next = null,
};
var res: *os.addrinfo = undefined;
- switch (os.system.getaddrinfo(name_c.ptr, port_c.ptr, &hints, &res)) {
+ switch (os.system.getaddrinfo(
+ name_c.ptr,
+ @ptrCast([*:0]const u8, port_c.ptr),
+ &hints,
+ &res)) {
0 => {},
c.EAI_ADDRFAMILY => return error.HostLacksNetworkAddresses,
c.EAI_AGAIN => return error.TemporaryNameServerFailure,