]> git.droids-corp.org - dpdk.git/blobdiff - drivers/net/mlx4/mlx4_ethdev.c
convert snprintf to strlcpy
[dpdk.git] / drivers / net / mlx4 / mlx4_ethdev.c
index fbeef16c8faef7068b148e1026652ecb4ba32f81..5f731e0238e7a9a2911d5d709b0146664bb1e705 100644 (file)
@@ -39,6 +39,7 @@
 #include <rte_ether.h>
 #include <rte_flow.h>
 #include <rte_pci.h>
+#include <rte_string_fns.h>
 
 #include "mlx4.h"
 #include "mlx4_flow.h"
@@ -120,7 +121,7 @@ try_dev_id:
                        goto try_dev_id;
                dev_port_prev = dev_port;
                if (dev_port == (priv->port - 1u))
-                       snprintf(match, sizeof(match), "%s", name);
+                       strlcpy(match, name, sizeof(match));
        }
        closedir(dir);
        if (match[0] == '\0') {