Browse Source

Fix issues #50 and #55

Ginger Bill 8 years ago
parent
commit
54ea70df98
2 changed files with 2 additions and 1 deletions
  1. 1 1
      core/decimal.odin
  2. 1 0
      core/fmt.odin

+ 1 - 1
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;

+ 1 - 0
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);