File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ pub fn integer_from_radix(all_characters string, radix u32) !Integer {
200200
201201@[direct_array_access]
202202fn validate_string (characters string , radix u32 ) ! {
203- sign_present := characters[0 ] == `+` || characters[0 ] == `-`
203+ sign_present := characters.len > 0 && (characters [0 ] == `+` || characters[0 ] == `-` )
204204
205205 start_index := if sign_present { 1 } else { 0 }
206206
@@ -261,7 +261,7 @@ fn integer_from_special_string(characters string, chunk_size int) Integer {
261261
262262@[direct_array_access]
263263fn integer_from_regular_string (characters string , radix u32 ) Integer {
264- sign_present := characters[0 ] == `+` || characters[0 ] == `-`
264+ sign_present := characters.len > 0 && (characters [0 ] == `+` || characters[0 ] == `-` )
265265
266266 signum := if sign_present {
267267 if characters[0 ] == `-` { - 1 } else { 1 }
You can’t perform that action at this time.
0 commit comments