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);