| ... | @@ -248,8 +248,8 @@ fn getName(allocator: *Allocator, header: ar_hdr, reader: anytype) ![]u8 { | ... | @@ -248,8 +248,8 @@ fn getName(allocator: *Allocator, header: ar_hdr, reader: anytype) ![]u8 { |
| 248 | var n = try allocator.alloc(u8, len); | 248 | var n = try allocator.alloc(u8, len); |
| 249 | defer allocator.free(n); | 249 | defer allocator.free(n); |
| 250 | try reader.readNoEof(n); | 250 | try reader.readNoEof(n); |
| 251 | const actual_len = mem.indexOfScalar(u8, n, @as(u8, 0)); | 251 | const actual_len = mem.indexOfScalar(u8, n, @as(u8, 0)) orelse n.len; |
| 252 | name = try allocator.dupe(u8, n[0..actual_len.?]); | 252 | name = try allocator.dupe(u8, n[0..actual_len]); |
| 253 | }, | 253 | }, |
| 254 | } | 254 | } |
| 255 | return name; | 255 | return name; |