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

Replaced old atoi() with better strtol() #1422

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

Conversation

seanm
Copy link
Contributor

@seanm seanm commented Jan 2, 2024

atoi() gives no opportunity for error checking, strtol() does. Though I did not actually improve error checking...

@mcuee mcuee added the Misc Whitespace, typo, coding style, etc label Jan 2, 2024
@Youw
Copy link
Member

Youw commented Jan 3, 2024

Though I did not actually improve error checking...

I don't see any actual benefin otherwise.
Is there?
Unless you're planning more changes on top of it.

@seanm
Copy link
Contributor Author

seanm commented Jan 4, 2024

I don't see any actual benefin otherwise.

There's no big benefit. It's just a little cleanup to remove an obsolete function.

@tormodvolden
Copy link
Contributor

atoi is not obsolete, it is just not recommended any longer :) strtol is better /if/ you add error checking.

@seanm
Copy link
Contributor Author

seanm commented Jan 4, 2024

strtol is better /if/ you add error checking

Draft error checking now added.

@seanm seanm force-pushed the atoi branch 2 times, most recently from d7bbd5a to e0ecc6a Compare January 21, 2024 04:06
atoi() gives no opportunity for error checking, strtol() does. Improved error checking.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Misc Whitespace, typo, coding style, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants