| ... | @@ -1332,8 +1332,10 @@ pub fn writeAr(self: Object, ar_format: Archive.Format, macho_file: *MachO, writ | ... | @@ -1332,8 +1332,10 @@ pub fn writeAr(self: Object, ar_format: Archive.Format, macho_file: *MachO, writ |
| 1332 | const file = macho_file.getFileHandle(self.file_handle); | 1332 | const file = macho_file.getFileHandle(self.file_handle); |
| 1333 | // TODO try using copyRangeAll | 1333 | // TODO try using copyRangeAll |
| 1334 | const gpa = macho_file.base.comp.gpa; | 1334 | const gpa = macho_file.base.comp.gpa; |
| 1335 | const data = try file.readToEndAlloc(gpa, size); | 1335 | const data = try gpa.alloc(u8, size); |
| 1336 | defer gpa.free(data); | 1336 | defer gpa.free(data); |
| | 1337 | const amt = try file.preadAll(data, 0); |
| | 1338 | if (amt != size) return error.InputOutput; |
| 1337 | try writer.writeAll(data); | 1339 | try writer.writeAll(data); |
| 1338 | } | 1340 | } |
| 1339 | | 1341 | |