diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2023-09-22 11:38:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-22 11:38:07 +0100 |
| commit | e14a4e79aede8a4d7543034e254b435d4f987359 (patch) | |
| tree | b5fe52b5f3fdf7dd337e36430765ec43a240470e | |
| parent | c23b5825bb88e0cdfccc652138cf76b49a530490 (diff) | |
| parent | 39c85cafa20b669c19cd4cfc18bc525a12da8d0b (diff) | |
Merge pull request #2808 from karl-zylinski/write-128-bit-int-buf-size
Fix for crash when using io.write_u128/io.write_i128 due to buffer being too small
| -rw-r--r-- | core/io/util.odin | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/io/util.odin b/core/io/util.odin index c77d0be9d..c24eb99c5 100644 --- a/core/io/util.odin +++ b/core/io/util.odin @@ -39,12 +39,12 @@ write_int :: proc(w: Writer, i: int, base: int = 10, n_written: ^int = nil) -> ( } write_u128 :: proc(w: Writer, i: u128, base: int = 10, n_written: ^int = nil) -> (n: int, err: Error) { - buf: [32]byte + buf: [39]byte s := strconv.append_bits_128(buf[:], i, base, false, 128, strconv.digits, nil) return write_string(w, s, n_written) } write_i128 :: proc(w: Writer, i: i128, base: int = 10, n_written: ^int = nil) -> (n: int, err: Error) { - buf: [32]byte + buf: [40]byte s := strconv.append_bits_128(buf[:], u128(i), base, true, 128, strconv.digits, nil) return write_string(w, s, n_written) } |