Only override the comma value on *_init if it is "invalid"

This commit is contained in:
gingerBill
2024-04-19 00:19:02 +01:00
parent 2416380f34
commit 3812d5e002
2 changed files with 8 additions and 2 deletions
+4 -1
View File
@@ -17,7 +17,10 @@ Writer :: struct {
// writer_init initializes a Writer that writes to w
writer_init :: proc(writer: ^Writer, w: io.Writer) {
writer.comma = ','
switch writer.comma {
case '\x00', '\n', '\r', 0xfffd:
writer.comma = ','
}
writer.w = w
}