mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Fix off by one error in %d parsing
This commit is contained in:
+1
-1
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user