fix: always use std.Io.Writer.writeAll to avoid write underflow

This commit is contained in:
CJ van den Berg 2025-10-30 18:04:37 +01:00
parent b556c1da61
commit ab4d1cdfa5
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -933,10 +933,10 @@ const Node = union(enum) {
try node.right.store(writer, eol_mode);
},
.leaf => |*leaf| {
_ = try writer.write(leaf.buf);
try writer.writeAll(leaf.buf);
if (leaf.eol) switch (eol_mode) {
.lf => _ = try writer.write("\n"),
.crlf => _ = try writer.write("\r\n"),
.lf => try writer.writeByte('\n'),
.crlf => try writer.writeAll("\r\n"),
};
},
}