aboutsummaryrefslogtreecommitdiff
path: root/lib/std/net.zig
diff options
context:
space:
mode:
authorEric Joldasov <bratishkaerik@getgoogleoff.me>2023-06-25 21:33:55 +0600
committerAndrew Kelley <andrew@ziglang.org>2023-06-25 14:51:03 -0700
commit0a868dacdd31b7d5c529a332da718683477a2505 (patch)
treea5d91a35d7f66b78c26110923eda548e52eb6258 /lib/std/net.zig
parent852eb272bf895ee6fc242e298e31d666caa9d0df (diff)
downloadzig-0a868dacdd31b7d5c529a332da718683477a2505.tar.gz
zig-0a868dacdd31b7d5c529a332da718683477a2505.zip
std.cstr: deprecate namespace
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
Diffstat (limited to 'lib/std/net.zig')
-rw-r--r--lib/std/net.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/net.zig b/lib/std/net.zig
index af291f6414..7a8ca62022 100644
--- a/lib/std/net.zig
+++ b/lib/std/net.zig
@@ -783,7 +783,7 @@ pub fn getAddressList(allocator: mem.Allocator, name: []const u8, port: u16) Get
errdefer result.deinit();
if (builtin.target.os.tag == .windows) {
- const name_c = try std.cstr.addNullByte(allocator, name);
+ const name_c = try allocator.dupeZ(u8, name);
defer allocator.free(name_c);
const port_c = try std.fmt.allocPrintZ(allocator, "{}", .{port});
@@ -855,7 +855,7 @@ pub fn getAddressList(allocator: mem.Allocator, name: []const u8, port: u16) Get
}
if (builtin.link_libc) {
- const name_c = try std.cstr.addNullByte(allocator, name);
+ const name_c = try allocator.dupeZ(u8, name);
defer allocator.free(name_c);
const port_c = try std.fmt.allocPrintZ(allocator, "{}", .{port});