Skip to content

Commit 1146f2a

Browse files
committed
UnpackReader.skip: fix skip primitive end too soon
1 parent 6e3d5dc commit 1146f2a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/io.zig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,10 @@ pub const UnpackReader = struct {
296296
},
297297
else => {
298298
var r = try self.rawReader(reader, header);
299-
try r.reader().skipBytes(std.math.maxInt(u64), .{});
299+
r.reader().skipBytes(std.math.maxInt(u64), .{}) catch |err| switch (err) {
300+
error.EndOfStream => {}, // This value is ended
301+
else => return err,
302+
};
300303
},
301304
}
302305
}

0 commit comments

Comments
 (0)