Commit b0bc4a6
committed
Use
The previous use of `unsafe_string2unsigned` handled non numeric input
based on the behaviour of 0 being returned by `unsafe_string2unsigned`,
which is then caught by the subsequent range check. It was well defined
behaviour of `std::strtoul`. However this was only discoverable, based
on looking at the implementation of `unsafe_string2unsigned` and reading
the documentation of `std::strtoul` or by using a debugger. The explict
check in the refactored version makes the handling of this case clear
from reading `parse_object_bits_encoding` only, without reference to
other code or documentation.parse_object_bits_encoding in parse_object_bits_encoding
1 parent 8a9217b commit b0bc4a6
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
776 | 776 | | |
777 | 777 | | |
778 | 778 | | |
779 | | - | |
780 | | - | |
| 779 | + | |
| 780 | + | |
781 | 781 | | |
782 | 782 | | |
783 | 783 | | |
| |||
786 | 786 | | |
787 | 787 | | |
788 | 788 | | |
789 | | - | |
| 789 | + | |
790 | 790 | | |
791 | 791 | | |
792 | 792 | | |
| |||
0 commit comments