aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-01-26 13:04:47 +0000
committergingerBill <bill@gingerbill.org>2024-01-26 13:04:47 +0000
commit9a9625f8858aa28fdf5dc0f5e65b7ea7a991576b (patch)
tree823c2174a0b749dd6f8bc2aeab365e4a73d987f3
parent15b40a4f292ec0fbb71d2a16a0f8b3cd52f41a9e (diff)
Fix #3053
-rw-r--r--core/fmt/fmt.odin18
1 files changed, 2 insertions, 16 deletions
diff --git a/core/fmt/fmt.odin b/core/fmt/fmt.odin
index f4fddd18d..25012eb65 100644
--- a/core/fmt/fmt.odin
+++ b/core/fmt/fmt.odin
@@ -954,24 +954,10 @@ _fmt_int :: proc(fi: ^Info, u: u64, base: int, is_signed: bool, bit_size: int, d
start := 0
flags: strconv.Int_Flags
- if fi.hash && !fi.zero { flags |= {.Prefix} }
- if fi.plus { flags |= {.Plus} }
+ if fi.hash { flags |= {.Prefix} }
+ if fi.plus { flags |= {.Plus} }
s := strconv.append_bits(buf[start:], u, base, is_signed, bit_size, digits, flags)
- if fi.hash && fi.zero && fi.indent == 0 {
- c: byte = 0
- switch base {
- case 2: c = 'b'
- case 8: c = 'o'
- case 12: c = 'z'
- case 16: c = 'x'
- }
- if c != 0 {
- io.write_byte(fi.writer, '0', &fi.n)
- io.write_byte(fi.writer, c, &fi.n)
- }
- }
-
prev_zero := fi.zero
defer fi.zero = prev_zero
fi.zero = false