git.droids-corp.org
/
dpdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e97f83e
)
ethdev: replace snprintf with strlcpy on init
author
Stephen Hemminger
<stephen@networkplumber.org>
Thu, 28 Feb 2019 22:47:54 +0000
(14:47 -0800)
committer
Ferruh Yigit
<ferruh.yigit@intel.com>
Wed, 20 Mar 2019 17:15:42 +0000
(18:15 +0100)
Don't need to use snprintf for simple name copy.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
lib/librte_ethdev/rte_ethdev.c
patch
|
blob
|
history
diff --git
a/lib/librte_ethdev/rte_ethdev.c
b/lib/librte_ethdev/rte_ethdev.c
index
95889ed
..
3f22536
100644
(file)
--- a/
lib/librte_ethdev/rte_ethdev.c
+++ b/
lib/librte_ethdev/rte_ethdev.c
@@
-459,7
+459,7
@@
rte_eth_dev_allocate(const char *name)
}
eth_dev = eth_dev_get(port_id);
- s
nprintf(eth_dev->data->name, sizeof(eth_dev->data->name), "%s", name
);
+ s
trlcpy(eth_dev->data->name, name, sizeof(eth_dev->data->name)
);
eth_dev->data->port_id = port_id;
eth_dev->data->mtu = ETHER_MTU;