commit 5919831529418ddf019b69e13ccccfce64837638 (tree)
parent 901aab8761daa5c2dae5e470d51f5b3bf76e2b78
Author: Luna <git@l4.pm>
Date: Mon, 30 Mar 2020 16:01:22 -0300
Stop using mem.len on array
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/std/net.zig b/lib/std/net.zig
@@ -273,10 +273,12 @@ pub const Address = extern union {
}
var resolved_scope_id: u32 = 0;
- if (std.mem.len(scope_id_value) > 0) {
- resolved_scope_id = std.fmt.parseInt(u32, &scope_id_value, 10) catch |err| blk: {
+ std.debug.warn("scope_id_value {} len {}\n", .{ scope_id_value, std.mem.len(scope_id_value) });
+ if (scope_id_index > 0) {
+ const scope_id_str = scope_id_value[0..scope_id_index];
+ resolved_scope_id = std.fmt.parseInt(u32, scope_id_str, 10) catch |err| blk: {
if (err != error.InvalidCharacter) return err;
- break :blk try if_nametoindex(&scope_id_value);
+ break :blk try if_nametoindex(scope_id_str);
};
}