From d07909551739a4487420204f12021e78944e6dbb Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 3 Feb 2018 10:27:33 +0000 Subject: [PATCH] Fix bug #179 --- core/fmt.odin | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/core/fmt.odin b/core/fmt.odin index 9c9c8d374..eb49ef588 100644 --- a/core/fmt.odin +++ b/core/fmt.odin @@ -303,14 +303,11 @@ write_type :: proc(buf: ^String_Buffer, ti: ^Type_Info) { _parse_int :: proc(s: string, offset: int) -> (result: int, new_offset: int, ok: bool) { - is_digit :: inline proc(r: rune) -> bool{ - return '0' <= r && r <= '9'; - } + is_digit :: inline proc(r: byte) -> bool { return '0' <= r && r <= '9' } new_offset = offset; - n := len(s[new_offset..]); - for new_offset <= n { - c := rune(s[new_offset]); + for new_offset <= len(s) { + c := s[new_offset]; if !is_digit(c) do break; new_offset += 1;