iperf icon indicating copy to clipboard operation
iperf copied to clipboard

Fix issue #1482 - not allow using option with missing argument

Open davidBar-On opened this issue 1 year ago • 1 comments

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

  • Issues fixed (if any): #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 avatar Mar 17 '23 07:03 davidBar-On

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.

swlars avatar Jul 24 '23 21:07 swlars