[dpdk-dev,18/18] app: test-bbdev: strcpy ok for allocated string 2

Message ID 152575385860.56689.9389660190378596857.stgit@localhost.localdomain (mailing list archive)
State Superseded, archived
Headers

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

Andy Green May 8, 2018, 4:30 a.m. UTC
  ---
 app/test-bbdev/test_bbdev_vector.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Patch

diff --git a/app/test-bbdev/test_bbdev_vector.c b/app/test-bbdev/test_bbdev_vector.c
index 5ad2a6535..373f94984 100644
--- a/app/test-bbdev/test_bbdev_vector.c
+++ b/app/test-bbdev/test_bbdev_vector.c
@@ -912,7 +912,8 @@  test_bbdev_vector_read(const char *filename,
 				}
 
 				entry = entry_extended;
-				strncat(entry, line, strlen(line));
+				/* entry has been allocated accordingly */
+				strcpy(&entry[strlen(entry)], line);
 
 				if (entry[strlen(entry) - 1] != ',')
 					break;