app/bbdev: use strcpy for allocated string
app/test-bbdev/test_bbdev_vector.c:895:3:
error: ‘strncpy’ output truncated before terminating nul copying as
many bytes from a string as its length [-Werror=stringop-truncation]
strncpy(entry, line, strlen(line));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/test-bbdev/test_bbdev_vector.c:917:5:
error: ‘strncat’ output truncated before terminating nul copying as
many bytes from a string as its length [-Werror=stringop-truncation]
strncat(entry, line, strlen(line));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fixes: f714a18885
("app/testbbdev: add test application for bbdev")
Cc: stable@dpdk.org
Signed-off-by: Andy Green <andy@warmcat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
This commit is contained in:
parent
3cef37eb98
commit
f2790f9cf8
@ -891,8 +891,7 @@ test_bbdev_vector_read(const char *filename,
|
||||
goto exit;
|
||||
}
|
||||
|
||||
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] == ','
|
||||
@ -914,7 +913,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;
|
||||
|
Loading…
Reference in New Issue
Block a user