From 3d25a9c1e07cfcb72250760b2c1a1d9d4f6174ed Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 8 Aug 2025 14:20:55 -0700 Subject: [PATCH] std.Io.Writer.Allocating.sendFile: use logicalPos fixes #24754 tested with `zig build test-std -Dskip-release` --- lib/std/Io/Writer.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/Io/Writer.zig b/lib/std/Io/Writer.zig index 86614e6254..f27e42ab47 100644 --- a/lib/std/Io/Writer.zig +++ b/lib/std/Io/Writer.zig @@ -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;