feat(utils): add workaround for start index greater than length
This commit is contained in:
@@ -62,6 +62,8 @@ pub fn getLongestSysInfoStringLen(strings: []const []const u8) usize {
|
|||||||
if (ansi_restet_index != null) {
|
if (ansi_restet_index != null) {
|
||||||
// `start` is the index of the last character of the ANSI reset escape sequence + 1
|
// `start` is the index of the last character of the ANSI reset escape sequence + 1
|
||||||
start = ansi_restet_index.? + ansi_reset.len + 1;
|
start = ansi_restet_index.? + ansi_reset.len + 1;
|
||||||
|
|
||||||
|
if (start > s.len) continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
longest_len = @max(longest_len, s[start..].len);
|
longest_len = @max(longest_len, s[start..].len);
|
||||||
|
|||||||
Reference in New Issue
Block a user