Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do proper error handling of strtonum #410

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AZero13
Copy link
Contributor

@AZero13 AZero13 commented Jul 4, 2023

Checking for an error string is the proper step, rather than checking for 0.
Have an error string for consistency.

@AZero13 AZero13 changed the title Ensure strtonum returns a number that is always positive in int range Do proper error handling with strtonum Jul 5, 2023
@AZero13 AZero13 requested a review from daztucker July 5, 2023 13:52
@AZero13
Copy link
Contributor Author

AZero13 commented Jul 5, 2023

@daztucker Fixed!

@daztucker
Copy link
Contributor

I've applied the cast change, but as I said above I do not see the need for the rest of this change since the existing error check is unambiguous. Can you give an example of when the existing code does the incorrect thing?

@AZero13 AZero13 force-pushed the UINT_MAX branch 3 times, most recently from 98dc593 to 556f58e Compare July 7, 2023 17:30
@AZero13 AZero13 changed the title Do proper error handling with strtonum Do proper error handling of strtonum Jul 8, 2023
@daztucker
Copy link
Contributor

You did not address my previous comment: " I do not see the need for the rest of this change since the existing error check is unambiguous. Can you give an example of when the existing code does the incorrect thing?"

Checking for an error string is the proper step.
Have an error string for consistency.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants