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

args: Add and use a helper to parse file descriptors #341

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

Conversation

alexlarsson
Copy link
Collaborator

This is a pure cleanup patch and should not affect anything. I was gonna use it for some other work which required yet another fd argument, but that fell through.

int the_fd;

the_fd = strtol (arg, &endptr, 10);
if (arg[0] == 0 || endptr[0] != 0 || the_fd < 0)

This comment was marked as resolved.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind, didn’t notice it was assigned to an int variable.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although it can still create strange truncations so I think this + long the_fd is necessary after all.

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