From f7641c24a3ba867ecca995ec9f294317f55eb723 Mon Sep 17 00:00:00 2001 From: utox39 Date: Wed, 10 Sep 2025 14:26:11 +0200 Subject: [PATCH] fix(ascii): fix the calculation of the alignment buffer size --- src/ascii.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ascii.zig b/src/ascii.zig index 72eea58..c733bc0 100644 --- a/src/ascii.zig +++ b/src/ascii.zig @@ -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) {