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

Check for argc in mpsc_test to avoid Segmentation Fault #4

Open
kudraw opened this issue Apr 29, 2018 · 0 comments
Open

Check for argc in mpsc_test to avoid Segmentation Fault #4

kudraw opened this issue Apr 29, 2018 · 0 comments

Comments

@kudraw
Copy link

kudraw commented Apr 29, 2018

mpsc_test doesn't check argc argument of main, while the program require at least argv[1] (capacity of the queue).
This cause the program to Segmentation Fault when launched without arguments.

Just check argc to avoid that, and print a small syntax help for the user.

Small patch is attached. Hope that can be useful. Thank you for the code provided.

argv.patch.gz

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

No branches or pull requests

1 participant