mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 14:25:16 +00:00
std.io.Reader: fix appendRemaining
This commit is contained in:
parent
4bca5faca6
commit
fc310ee7bc
@ -690,7 +690,11 @@ pub const Manifest = struct {
|
||||
const size = iter.next() orelse return error.InvalidFormat;
|
||||
const inode = iter.next() orelse return error.InvalidFormat;
|
||||
const mtime_nsec_str = iter.next() orelse return error.InvalidFormat;
|
||||
const digest_str = iter.next() orelse return error.InvalidFormat;
|
||||
const digest_str = iter.next() orelse {
|
||||
std.debug.print("contents:\n{s}\n", .{file_contents});
|
||||
@breakpoint();
|
||||
return error.InvalidFormat;
|
||||
};
|
||||
const prefix_str = iter.next() orelse return error.InvalidFormat;
|
||||
const file_path = iter.rest();
|
||||
|
||||
|
||||
@ -266,10 +266,9 @@ pub fn appendRemaining(
|
||||
error.EndOfStream => break,
|
||||
error.ReadFailed => return error.ReadFailed,
|
||||
};
|
||||
if (n >= dest.len) {
|
||||
if (n > dest.len) {
|
||||
r.end = n - dest.len;
|
||||
list.items.len += dest.len;
|
||||
if (n == dest.len) return;
|
||||
return error.StreamTooLong;
|
||||
}
|
||||
list.items.len += n;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user