diff options
author | Bruce A. Mah <bmah@es.net> | 2014-08-25 16:43:46 -0700 |
---|---|---|
committer | Bruce A. Mah <bmah@es.net> | 2014-08-25 16:43:46 -0700 |
commit | f50627706fa67808ba2c04c66bd4012510d4ca71 (patch) | |
tree | 99788314a167683001b1248bfceb0451d0f26bb0 /src/iperf_api.c | |
parent | e6fba4e8d74160db764fe1fc45ed14bd540490a6 (diff) | |
download | iperf3-f50627706fa67808ba2c04c66bd4012510d4ca71.tar.gz |
When parsing the -b (bandwidth) argument, use 10-based suffices.
We support using k, m, and g as suffices on input values. In most
cases these are 2-based suffixes (i.e. K == 1024) because they are
sizes of objects. In the case of rates, we need to use 10-based
suffices (i.e. K == 1000).
We do this by implementing (using copy-and-paste) a unit_atof_rate()
subroutine that parses strings similarly to unit_atof but using
10-based suffices instead.
Fixes #173.
Diffstat (limited to 'src/iperf_api.c')
-rw-r--r-- | src/iperf_api.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/iperf_api.c b/src/iperf_api.c index 804ccdb..acc1366 100644 --- a/src/iperf_api.c +++ b/src/iperf_api.c @@ -683,7 +683,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) return -1; } } - test->settings->rate = unit_atof(optarg); + test->settings->rate = unit_atof_rate(optarg); rate_flag = 1; client_flag = 1; break; |