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

RSilicon
Copy link
Contributor

@RSilicon RSilicon commented Jul 4, 2023

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

ssh-add.c Outdated Show resolved Hide resolved
@RSilicon RSilicon changed the title Ensure strtonum returns a number that is always positive in int range Do proper error handling with strtonum Jul 5, 2023
@RSilicon RSilicon requested a review from daztucker July 5, 2023 13:52
@RSilicon
Copy link
Contributor Author

RSilicon 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?

@RSilicon RSilicon force-pushed the UINT_MAX branch 3 times, most recently from 98dc593 to 556f58e Compare July 7, 2023 17:30
@RSilicon RSilicon 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