diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-04-29 20:06:29 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-04-29 20:06:29 +0100 |
| commit | 54ea70df985546fa2d1fc95f55b5a83a41ee469c (patch) | |
| tree | 9d0e22f371d45f525e7651462c593cc1d3133788 | |
| parent | c7575164ccba1b16d3ee3f160c6b4ebd2b337307 (diff) | |
Fix issues #50 and #55
| -rw-r--r-- | core/decimal.odin | 2 | ||||
| -rw-r--r-- | core/fmt.odin | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/core/decimal.odin b/core/decimal.odin index ae3d5fee9..b0b730f99 100644 --- a/core/decimal.odin +++ b/core/decimal.odin @@ -156,7 +156,7 @@ shift_left :: proc(a: ^Decimal, k: uint) { quo := n/10; rem := n - 10*quo; w--; - if w < len(a.digits) { + if 0 <= w && w < len(a.digits) { a.digits[w] = cast(byte)('0' + rem); } else if rem != 0 { a.trunc = true; diff --git a/core/fmt.odin b/core/fmt.odin index 409e37b4f..9c6b6c4b2 100644 --- a/core/fmt.odin +++ b/core/fmt.odin @@ -1025,6 +1025,7 @@ fmt_arg :: proc(fi: ^Fmt_Info, arg: any, verb: rune) { base_arg := arg; base_arg.type_info = type_info_base(base_arg.type_info); match a in base_arg { + case any: fmt_arg(fi, a, verb); case bool: fmt_bool(fi, a, verb); case f32: fmt_float(fi, cast(f64)a, 32, verb); case f64: fmt_float(fi, a, 64, verb); |