feat(utils): add workaround for start index greater than length

This commit is contained in:
utox39
2025-08-10 00:37:37 +02:00
parent 3bcfff5bdc
commit d55af958e7

View File

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