aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorblob1807 <12388588+blob1807@users.noreply.github.com>2024-12-22 23:10:42 +1000
committerblob1807 <12388588+blob1807@users.noreply.github.com>2024-12-22 23:10:42 +1000
commitf07a6f463c16c3dc5cdadd6ce4e77a855ac6816d (patch)
treeeff611018434699d21761f59eae07fc362e056e6 /core
parent597fba7c31f5e927b0c7431444dad132352b4046 (diff)
Fix io.write_escaped_rune not writing full value
Diffstat (limited to 'core')
-rw-r--r--core/io/util.odin10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/io/util.odin b/core/io/util.odin
index 296be7bc0..fdbbd5b9f 100644
--- a/core/io/util.odin
+++ b/core/io/util.odin
@@ -132,9 +132,13 @@ write_encoded_rune :: proc(w: Writer, r: rune, write_quote := true, n_written: ^
buf: [2]byte
s := strconv.append_bits(buf[:], u64(r), 16, true, 64, strconv.digits, nil)
switch len(s) {
- case 0: write_string(w, "00", &n) or_return
- case 1: write_byte(w, '0', &n) or_return
- case 2: write_string(w, s, &n) or_return
+ case 0:
+ write_string(w, "00", &n) or_return
+ case 1:
+ write_byte(w, '0', &n) or_return
+ fallthrough
+ case 2:
+ write_string(w, s, &n) or_return
}
} else {
write_rune(w, r, &n) or_return