feat(ascii): read the ascii art file in read-only mode
This commit is contained in:
@@ -72,7 +72,7 @@ pub fn printAsciiAndModules(allocator: std.mem.Allocator, ascii_art_path: ?[]u8,
|
|||||||
|
|
||||||
var ascii_art_data: []const u8 = undefined;
|
var ascii_art_data: []const u8 = undefined;
|
||||||
if (ascii_art_path) |ascii| {
|
if (ascii_art_path) |ascii| {
|
||||||
const ascii_file = try std.fs.cwd().openFile(ascii, .{});
|
const ascii_file = try std.fs.cwd().openFile(ascii, .{ .mode = .read_only });
|
||||||
defer ascii_file.close();
|
defer ascii_file.close();
|
||||||
const file_size = (try ascii_file.stat()).size;
|
const file_size = (try ascii_file.stat()).size;
|
||||||
ascii_art_data = try utils.readFile(allocator, ascii_file, file_size);
|
ascii_art_data = try utils.readFile(allocator, ascii_file, file_size);
|
||||||
|
|||||||
Reference in New Issue
Block a user