Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix tz parse failure from out of bounds error #8
Oh my god, I spent like an hour debugging this problem today because I didn't see this PR!
I've merged this because I prefer having those two expressions as variables now that I look at it. The good news is we ended up with pretty much the same solution:
transition_type: flags_to_transition_type(tz.standard_flags.get(i).unwrap_or(&0) != &0, tz.gmt_flags.get(i).unwrap_or(&0) != &0),
I wanted to look up how the official zoneinfo code handles this case, and the code confirms that if those values are missing, they should be assumed to be 0: https://github.com/eggert/tz/blob/f9bd527016f806611e58a99d759d00c64c46a938/tzfile.h#L70-L80
Anyway, thanks for this. I'm going to publish a release today to fix the exa issue.