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 issue #1482 - not allow using option with missing argument #1485

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

Conversation

davidBar-On
Copy link
Contributor

  • Version of iperf3 (or development branch, such as master or
    3.1-STABLE) to which this pull request applies:
    master

  • Issues fixed (if any):
    Issue of argument '-i' when omitting the value #1482

  • Brief description of code changes (suitable for use as a commit message):

Suggested fix for preventing iperf3 from using an option as a missing argument for the previous option. I.e. in -i -u the "-u" was used as the -i argument, and the default TCP was running instead of UDP test.

The suggested fix assumes that negative argument is not allowed for all numeric options, and that no string argument can start with "-" (e.g. for title, extra-data, username, file). A more robust fix could be by checking that optarg is numeric in each case where atoi() is used.

@davidBar-On davidBar-On changed the title Fix issue #1482 - not allow using option as missing argument for an o… Fix issue #1482 - not allow using option with missing argument May 4, 2023
@swlars
Copy link
Contributor

swlars commented Jul 24, 2023

We like the idea behind this, but we're not quite sure if this is the best solution because of the restriction that it places on input parameters.

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