[11/25] net/atlantic: replace snprintf with strlcpy

Message ID 20230601150106.18375-12-stephen@networkplumber.org (mailing list archive)
State Rejected
Delegated to: Thomas Monjalon
Headers
Series replace snprintf with strlcpy |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger June 1, 2023, 3 p.m. UTC
  Suggested by devtools/cocci/strlcpy-with-header.cocci

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/atlantic/atl_ethdev.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
  

Patch

diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c
index 3a028f429002..09a7d9c8c88f 100644
--- a/drivers/net/atlantic/atl_ethdev.c
+++ b/drivers/net/atlantic/atl_ethdev.c
@@ -1006,9 +1006,8 @@  atl_dev_xstats_get_names(struct rte_eth_dev *dev __rte_unused,
 
 	if (xstats_names) {
 		for (i = 0; i < size && i < count; i++) {
-			snprintf(xstats_names[i].name,
-				RTE_ETH_XSTATS_NAME_SIZE, "%s",
-				atl_xstats_tbl[i].name);
+			strlcpy(xstats_names[i].name, atl_xstats_tbl[i].name,
+				RTE_ETH_XSTATS_NAME_SIZE);
 		}
 	}