Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If the string to parse is "0" (or "00", "000", "0000...", etc.) then after all the "leading zeroes" have been skipped, cur and end will point to the same location, causing the function to return false. To fix, check if we have reached end-of-string after skipping the leading zeroes. If we have reached the end of the string and this is not an empty string (i.e. count > 0) then the parsed integer has value 0 and we can return true.
- Loading branch information