X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest-crypto-perf%2Fcperf_test_vector_parsing.c;h=1e9dfcfff087997580104ef7230bf17d53ca8e95;hb=25d5c40f252fb77ed78a7baa5d6e54912ad83941;hp=26321d004d5ff8e7c26d099ce0e6adc691248594;hpb=174a1631d577fc0213962e8deb2fbdce78446dee;p=dpdk.git diff --git a/app/test-crypto-perf/cperf_test_vector_parsing.c b/app/test-crypto-perf/cperf_test_vector_parsing.c index 26321d004d..1e9dfcfff0 100644 --- a/app/test-crypto-perf/cperf_test_vector_parsing.c +++ b/app/test-crypto-perf/cperf_test_vector_parsing.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2016-2017 Intel Corporation */ -#ifdef RTE_EXEC_ENV_BSDAPP +#ifdef RTE_EXEC_ENV_FREEBSD #define _WITH_GETLINE #endif #include @@ -506,8 +506,7 @@ parse_file(struct cperf_test_vector *vector, struct cperf_options *opts) if (entry == NULL) return -1; - memset(entry, 0, strlen(line) + 1); - strncpy(entry, line, strlen(line)); + strcpy(entry, line); /* check if entry ends with , or = */ if (entry[strlen(entry) - 1] == ',' @@ -524,8 +523,8 @@ parse_file(struct cperf_test_vector *vector, struct cperf_options *opts) if (entry_extended == NULL) goto err; entry = entry_extended; - - strncat(entry, line, strlen(line)); + /* entry has been allocated accordingly */ + strcpy(&entry[strlen(entry)], line); if (entry[strlen(entry) - 1] != ',') break;