mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
std.Io.Writer.Allocating.sendFile: use logicalPos
fixes #24754 tested with `zig build test-std -Dskip-release`
This commit is contained in:
parent
6219c015d8
commit
3d25a9c1e0
1 changed files with 1 additions and 1 deletions
|
|
@ -2634,7 +2634,7 @@ pub const Allocating = struct {
|
|||
const gpa = a.allocator;
|
||||
var list = a.toArrayList();
|
||||
defer setArrayList(a, list);
|
||||
const pos = file_reader.pos;
|
||||
const pos = file_reader.logicalPos();
|
||||
const additional = if (file_reader.getSize()) |size| size - pos else |_| std.atomic.cache_line;
|
||||
if (additional == 0) return error.EndOfStream;
|
||||
list.ensureUnusedCapacity(gpa, limit.minInt64(additional)) catch return error.WriteFailed;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue