authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2020-09-04 12:48:36+02:00
committergravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2020-09-04 12:48:36+02:00
log3c8e1bc25b6d122ce1295e2e33bb9f54ae801ec0
tree7e54782cc954ef0bebb4e90954884d614365f40d
parent90743881cf10c4f90da4a8c187997e9eab4d17d5

std: Fix for 32bit systems


1 files changed, 4 insertions(+), 1 deletions(-)

lib/std/fs.zig+4-1
...@@ -1457,7 +1457,10 @@ pub const Dir = struct {...@@ -1457,7 +1457,10 @@ pub const Dir = struct {
1457 var file = try self.openFile(file_path, .{});1457 var file = try self.openFile(file_path, .{});
1458 defer file.close();1458 defer file.close();
14591459
1460 const stat_size = size_hint orelse try file.getEndPos();1460 // If the file size doesn't fit a usize it'll be certainly greater than
1461 // `max_bytes`
1462 const stat_size = size_hint orelse math.cast(usize, try file.getEndPos()) catch
1463 return error.FileTooBig;
14611464
1462 return file.readToEndAllocOptions(allocator, max_bytes, stat_size, alignment, optional_sentinel);1465 return file.readToEndAllocOptions(allocator, max_bytes, stat_size, alignment, optional_sentinel);
1463 }1466 }