diff --git a/tools/cheat-builder/make-acl.zig b/tools/cheat-builder/make-acl.zig index ba41553..3fece88 100644 --- a/tools/cheat-builder/make-acl.zig +++ b/tools/cheat-builder/make-acl.zig @@ -120,9 +120,14 @@ pub fn main() !void { } fn readAll(allocator: Allocator, file: File) ![]u8 { - const file_size: usize = @intCast(try file.getEndPos()); + //const file_size: usize = @intCast(try file.getEndPos()); + //const file_contents = try allocator.alloc(u8, file_size); + try file.seekFromEnd(0); + const file_size = try file.getPos(); const file_contents = try allocator.alloc(u8, file_size); + try file.seekTo(0); + const readed = try file.readAll(file_contents); if (readed != file_size) { return error.EndOfStream;