mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 08:16:13 +03:00
termio: fix some mild memory corruption
This commit is contained in:
@ -194,9 +194,9 @@ pub fn MessageData(comptime Elem: type, comptime small_size: comptime_int) type
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Returns a const slice of the data pointed to by this request.
|
/// Returns a const slice of the data pointed to by this request.
|
||||||
pub fn slice(self: Self) []const Elem {
|
pub fn slice(self: *const Self) []const Elem {
|
||||||
return switch (self) {
|
return switch (self.*) {
|
||||||
.small => |v| v.data[0..v.len],
|
.small => |*v| v.data[0..v.len],
|
||||||
.stable => |v| v,
|
.stable => |v| v,
|
||||||
.alloc => |v| v.data,
|
.alloc => |v| v.data,
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user