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

Fix unitialized access of err and erroneous error message. #41

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

haesbaert
Copy link

malloc(3) already sets errno and we should return on NULL.

Hi, sorry if this is too silly I was just going over the code and noticed it, also you could use err(3) or errx(3) and cut some lines.
I have more silly fixes like this I can push if you want.

@haesbaert
Copy link
Author

haesbaert commented Jan 19, 2022

I don't have a proper setup to test this yet for regressions, so I didn't build it.

Again, I apologize if the changes are too pedantic.

@haesbaert haesbaert force-pushed the haesbaert branch 2 times, most recently from 63af27a to bf4cca5 Compare January 19, 2022 22:49
@slp
Copy link
Contributor

slp commented Jan 21, 2022

Hi! Thanks a lot for taking the interest in working on this. Your changes look good to me, just a couple of comments:

  • Could you please add a Sign-off-by line to the commits?

  • Importing one of the ideas from Rust formatting, I'd prefer to avoid if-else blocks without braces, as I find them prone to errors. Could you please re-add them?

malloc(3) already sets errno and we should return on NULL.

Signed-off-by: Christiano Haesbaert <[email protected]>
Saves you headache when stdout is not a tty.

Signed-off-by: Christiano Haesbaert <[email protected]>
Preparation for a couple of fixes/improvements, these are only re-indents and
some tabs vs spaces so that the next commit intention is clear.

Signed-off-by: Christiano Haesbaert <[email protected]>
  o Make sure we print errors and warnings to stderr.
  o Don't assume fork succeeds.
  o Use err(3) and warn(3), cuts some lines.
  o Keep braces for single liners as requested.

Signed-off-by: Christiano Haesbaert <[email protected]>
@haesbaert
Copy link
Author

Thanks for reviewing it.
I've re-added the braces as requested as well as the Sign-off-by.

@slp slp self-requested a review as a code owner November 14, 2022 18:08
@tylerfanelli
Copy link
Collaborator

tylerfanelli commented Apr 22, 2024

@haesbaert There seems to be some conflicts with this PR as a lot has been done since its submission. Do you mind rebasing on main?

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.

3 participants