Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit e5e59c1

Browse files
author
Fraser J. Gordon
committed
Fix an off-by-one error causing date parsing to fail
Number parsing would fail if it was the last item in the input string.
1 parent a998114 commit e5e59c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

engine/src/date.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static bool match_number(MCStringRef p_input, uindex_t &x_offset, int4& r_number
180180

181181
int4 t_number;
182182
t_number = 0;
183-
while(x_offset < t_length && isdigit(t_char))
183+
while(x_offset <= t_length && isdigit(t_char))
184184
{
185185
t_number = t_number * 10 + t_char - '0';
186186
t_char = MCStringGetCharAtIndex(p_input, x_offset++);

0 commit comments

Comments
 (0)