| ... | @@ -719,7 +719,7 @@ pub fn getAddressList(allocator: mem.Allocator, name: []const u8, port: u16) !*A | ... | @@ -719,7 +719,7 @@ pub fn getAddressList(allocator: mem.Allocator, name: []const u8, port: u16) !*A |
| 719 | const name_c = try std.cstr.addNullByte(allocator, name); | 719 | const name_c = try std.cstr.addNullByte(allocator, name); |
| 720 | defer allocator.free(name_c); | 720 | defer allocator.free(name_c); |
| 721 | | 721 | |
| 722 | const port_c = try std.fmt.allocPrint(allocator, "{}\x00", .{port}); | 722 | const port_c = try std.fmt.allocPrintZ(allocator, "{}", .{port}); |
| 723 | defer allocator.free(port_c); | 723 | defer allocator.free(port_c); |
| 724 | | 724 | |
| 725 | const sys = if (builtin.target.os.tag == .windows) os.windows.ws2_32 else os.system; | 725 | const sys = if (builtin.target.os.tag == .windows) os.windows.ws2_32 else os.system; |
| ... | @@ -734,7 +734,7 @@ pub fn getAddressList(allocator: mem.Allocator, name: []const u8, port: u16) !*A | ... | @@ -734,7 +734,7 @@ pub fn getAddressList(allocator: mem.Allocator, name: []const u8, port: u16) !*A |
| 734 | .next = null, | 734 | .next = null, |
| 735 | }; | 735 | }; |
| 736 | var res: *os.addrinfo = undefined; | 736 | var res: *os.addrinfo = undefined; |
| 737 | const rc = sys.getaddrinfo(name_c.ptr, std.meta.assumeSentinel(port_c.ptr, 0), &hints, &res); | 737 | const rc = sys.getaddrinfo(name_c.ptr, port_c.ptr, &hints, &res); |
| 738 | if (builtin.target.os.tag == .windows) switch (@intToEnum(os.windows.ws2_32.WinsockError, @intCast(u16, rc))) { | 738 | if (builtin.target.os.tag == .windows) switch (@intToEnum(os.windows.ws2_32.WinsockError, @intCast(u16, rc))) { |
| 739 | @intToEnum(os.windows.ws2_32.WinsockError, 0) => {}, | 739 | @intToEnum(os.windows.ws2_32.WinsockError, 0) => {}, |
| 740 | .WSATRY_AGAIN => return error.TemporaryNameServerFailure, | 740 | .WSATRY_AGAIN => return error.TemporaryNameServerFailure, |