From e724c46c649dc36483f62316b1323970de1b1598 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 13 Nov 2024 12:55:43 -0800 Subject: [PATCH] termio: fix some mild memory corruption --- src/termio/message.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/termio/message.zig b/src/termio/message.zig index 22b72235b..c88a12f14 100644 --- a/src/termio/message.zig +++ b/src/termio/message.zig @@ -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. - pub fn slice(self: Self) []const Elem { - return switch (self) { - .small => |v| v.data[0..v.len], + pub fn slice(self: *const Self) []const Elem { + return switch (self.*) { + .small => |*v| v.data[0..v.len], .stable => |v| v, .alloc => |v| v.data, };