Fix protocol.DevicePath.next() (#30883)

fix for https://codeberg.org/ziglang/zig/issues/30882

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30883
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
Co-authored-by: jsentity <jsentity@noreply.codeberg.org>
Co-committed-by: jsentity <jsentity@noreply.codeberg.org>
This commit is contained in:
jsentity 2026-01-18 21:42:34 +01:00 committed by Andrew Kelley
parent d2dda0737b
commit 27e8d05ee8

View file

@ -28,7 +28,7 @@ pub const DevicePath = extern struct {
pub fn next(self: *const DevicePath) ?*const DevicePath {
const bytes: [*]const u8 = @ptrCast(self);
const next_node: *const DevicePath = @ptrCast(bytes + self.length);
if (next_node.type == .end and @as(uefi.DevicePath.End.Subtype, @enumFromInt(self.subtype)) == .end_entire)
if (next_node.type == .end and @as(uefi.DevicePath.End.Subtype, @enumFromInt(next_node.subtype)) == .end_entire)
return null;
return next_node;