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

Make use of PATH_MAX for fullpath #157

Closed
wants to merge 2 commits into from

Conversation

kbabioch
Copy link
Contributor

@kbabioch kbabioch commented May 4, 2018

No description provided.

Instead of hardcoding the buffer size to 256, using PATH_MAX makes more
sense here, since this can be defined differently on different
platforms. This is not perfect, though, refer to [1] for some details.
In our case it should be good enough.

[1]: https://eklitzke.org/path-max-is-tricky
This checks the return code of snprintf() and makes sure that fullpath
actually fits into a buffer of size PATH_MAX. Otherwise, it will output
an error and exit.
@kbabioch
Copy link
Contributor Author

kbabioch commented May 4, 2018

Will re-submit.

@kbabioch kbabioch closed this May 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant