fix(ascii): fix the calculation of the alignment buffer size
This commit is contained in:
@@ -115,7 +115,7 @@ pub fn printAscii(allocator: std.mem.Allocator, ascii_art_path: ?[]u8, sys_info_
|
||||
while (i < max_len) : (i += 1) {
|
||||
// Print the ascii art if the width of the terminal is greater than the spacing (5) + the longest ascii art row length + the longest sys info string length
|
||||
if (can_print_ascii_art) {
|
||||
const alignment_buffer = try allocator.alloc(u8, longest_ascii_art_row_len - (try utils.countCodepoints(ascii_art_items[i])) + spacing);
|
||||
const alignment_buffer = try allocator.alloc(u8, if (i < ascii_art_len) longest_ascii_art_row_len - (try utils.countCodepoints(ascii_art_items[i])) + spacing else longest_ascii_art_row_len + spacing);
|
||||
@memset(alignment_buffer, ' ');
|
||||
|
||||
if (i < ascii_art_len) {
|
||||
|
||||
Reference in New Issue
Block a user