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);