From d55af958e727867ca02a0b89e79235401a4e394b Mon Sep 17 00:00:00 2001 From: utox39 Date: Sun, 10 Aug 2025 00:37:37 +0200 Subject: [PATCH] feat(utils): add workaround for start index greater than length --- src/utils.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils.zig b/src/utils.zig index f1075b0..a58144e 100644 --- a/src/utils.zig +++ b/src/utils.zig @@ -62,6 +62,8 @@ pub fn getLongestSysInfoStringLen(strings: []const []const u8) usize { if (ansi_restet_index != null) { // `start` is the index of the last character of the ANSI reset escape sequence + 1 start = ansi_restet_index.? + ansi_reset.len + 1; + + if (start > s.len) continue; } longest_len = @max(longest_len, s[start..].len);