mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-02 20:58:15 +00:00
Fix io.write_escaped_rune not writing full value
This commit is contained in:
+7
-3
@@ -132,9 +132,13 @@ write_encoded_rune :: proc(w: Writer, r: rune, write_quote := true, n_written: ^
|
|||||||
buf: [2]byte
|
buf: [2]byte
|
||||||
s := strconv.append_bits(buf[:], u64(r), 16, true, 64, strconv.digits, nil)
|
s := strconv.append_bits(buf[:], u64(r), 16, true, 64, strconv.digits, nil)
|
||||||
switch len(s) {
|
switch len(s) {
|
||||||
case 0: write_string(w, "00", &n) or_return
|
case 0:
|
||||||
case 1: write_byte(w, '0', &n) or_return
|
write_string(w, "00", &n) or_return
|
||||||
case 2: write_string(w, s, &n) or_return
|
case 1:
|
||||||
|
write_byte(w, '0', &n) or_return
|
||||||
|
fallthrough
|
||||||
|
case 2:
|
||||||
|
write_string(w, s, &n) or_return
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
write_rune(w, r, &n) or_return
|
write_rune(w, r, &n) or_return
|
||||||
|
|||||||
Reference in New Issue
Block a user