iperf
iperf copied to clipboard
Fix issue #1482 - not allow using option with missing argument
-
Version of iperf3 (or development branch, such as
master
or3.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.
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.