From 658435f1b9ea263cc2f1559f724211e8333beae3 Mon Sep 17 00:00:00 2001 From: MarenFayre <82266301+MarenFayre@users.noreply.github.com> Date: Sun, 8 Jan 2023 19:59:48 +0100 Subject: [PATCH] Fix off by one error in %d parsing --- core/fmt/fmt.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/fmt/fmt.odin b/core/fmt/fmt.odin index 79b575482..c189b3a8d 100644 --- a/core/fmt/fmt.odin +++ b/core/fmt/fmt.odin @@ -547,7 +547,7 @@ _parse_int :: proc(s: string, offset: int) -> (result: int, new_offset: int, ok: is_digit :: #force_inline proc(r: byte) -> bool { return '0' <= r && r <= '9' } new_offset = offset - for new_offset <= len(s) { + for new_offset < len(s) { c := s[new_offset] if !is_digit(c) { break