Skip to content
This repository has been archived by the owner on Dec 17, 2023. It is now read-only.

Use getopt_long() to standardize command line processing #41

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

Conversation

rread
Copy link

@rread rread commented May 14, 2020

I noticed that a missing parameter can cause a segfault because the original code did no sanity checking on argv[]. A better solution is to use a standard cli parsing facility like getopt_long().

One downside is switching to getopt forced changing the nonstandard short commands
"-ld" and "-lm" to "-l" and "-m", respectively.

Also prevents segfaults when missing parameters are passed.
Switching to getops forced changng nonstandard short comamnds
"-ld" and "-lm" to "-l" and "-m", respectively.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant