From faf2fd18d33de246c5bb03905f25290108e1dd30 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Sun, 22 Jan 2023 17:34:38 +0100 Subject: std: eliminate pointless meta.assumeSentinel() usage This fixes a bug in std.net caused during the introduction of meta.assumeSentinel due to the unfortunate semantics of mem.span() This leaves only 3 remaining uses of meta.assumeSentinel() in the standard library, each of which could be a simple @ptrCast([*:0]T, foo) instead. I think this function should likely be removed. --- lib/std/net.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/std/net.zig') diff --git a/lib/std/net.zig b/lib/std/net.zig index 4a567e0e8f..409461bf06 100644 --- a/lib/std/net.zig +++ b/lib/std/net.zig @@ -1687,7 +1687,7 @@ fn dnsParseCallback(ctx: dpc_ctx, rr: u8, data: []const u8, packet: []const u8) var tmp: [256]u8 = undefined; // Returns len of compressed name. strlen to get canon name. _ = try os.dn_expand(packet, data, &tmp); - const canon_name = mem.sliceTo(std.meta.assumeSentinel(&tmp, 0), 0); + const canon_name = mem.sliceTo(&tmp, 0); if (isValidHostName(canon_name)) { ctx.canon.items.len = 0; try ctx.canon.appendSlice(canon_name); -- cgit v1.2.3