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

added a few checks for null pointers #16

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

Conversation

rugglcon
Copy link

@rugglcon rugglcon commented Oct 10, 2017

Wherever there was a case of a null pointer, I just had it return NULL as that's what seemed to be the style you have in your functions, I just stuck to that. Let me know if there's any problems. Takes care of #3

@osiewicz
Copy link
Owner

osiewicz commented Oct 11, 2017

Hey,
Thanks for commiting! Actually, return values like 1 or 0 are passe - they don't tell the story about the error that happened. Also, I tend to check for null pointers and just return from there - as in,

if(settings)

increases your nesting depth by one, and that's not neccessarily good - I tend to just handle errors up front like so:

if(settings == NULL)

since it seems more explicit - you handle errors directly after action (and in case of the former usage, you won't see any error handling until the appropiate else - which might happen in 1000 lines (although that would be a sign of code smell). Anyways, some of your proposed changes might make their way into main client.
Thank you!

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.

None yet

2 participants