Browse Source

Merge pull request #2297 from MarenFayre/d-parsing

Fix off by one error in %d parsing
gingerBill 2 years ago
parent
commit
b0756f9e29
1 changed files with 1 additions and 1 deletions
  1. 1 1
      core/fmt/fmt.odin

+ 1 - 1
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' }
 	is_digit :: #force_inline proc(r: byte) -> bool { return '0' <= r && r <= '9' }
 
 
 	new_offset = offset
 	new_offset = offset
-	for new_offset <= len(s) {
+	for new_offset < len(s) {
 		c := s[new_offset]
 		c := s[new_offset]
 		if !is_digit(c) {
 		if !is_digit(c) {
 			break
 			break