From 50578e5dafba5e4235f579dba4d5426e5196cc79 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Mon, 23 Dec 2024 07:14:40 -0600 Subject: [PATCH] screen: use empty slice instead of undefined Use an empty slice instead of undefined for the screen's default buffer. This prevents segfaults if an app is deinitialized prior to receiving a winsize event. --- src/Screen.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Screen.zig b/src/Screen.zig index ed2f3e1..ee7a780 100644 --- a/src/Screen.zig +++ b/src/Screen.zig @@ -16,7 +16,7 @@ height: u16 = 0, width_pix: u16 = 0, height_pix: u16 = 0, -buf: []Cell = undefined, +buf: []Cell = &.{}, cursor_row: u16 = 0, cursor_col: u16 = 0,