diff options
author | Bruce A. Mah <bmah@es.net> | 2014-02-21 13:24:38 -0800 |
---|---|---|
committer | Bruce A. Mah <bmah@es.net> | 2014-02-21 13:24:38 -0800 |
commit | a3736b64e77f51518754241126fa296decc31b66 (patch) | |
tree | 4bda1c74864cba5e5b2a53c532b685a9d5a147e0 /src/iperf_api.c | |
parent | f2c4e2b5bd343e06635613e87463b4cabfe98b27 (diff) | |
download | iperf3-a3736b64e77f51518754241126fa296decc31b66.tar.gz |
Don't append a colon and two spaces to title in --json output.
Resolves Issue 139.
Diffstat (limited to 'src/iperf_api.c')
-rw-r--r-- | src/iperf_api.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/iperf_api.c b/src/iperf_api.c index 4313296..05de7b7 100644 --- a/src/iperf_api.c +++ b/src/iperf_api.c @@ -772,8 +772,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) #endif break; case 'T': - test->title = malloc(strlen(optarg) + 4); - sprintf(test->title, "%s: ", optarg); + test->title = strdup(optarg); client_flag = 1; break; case 'C': @@ -2609,7 +2608,7 @@ iprintf(struct iperf_test *test, const char* format, ...) int r; if (test->title) - fputs(test->title, stdout); + printf("%s: ", test->title); va_start(argp, format); r = vprintf(format, argp); va_end(argp); |