memzone: clarify support for zero-length memzones
[dpdk.git] / lib / librte_eal / common / eal_common_bus.c
index 5c63ced..0943851 100644 (file)
@@ -35,6 +35,8 @@
 #include <sys/queue.h>
 
 #include <rte_bus.h>
+#include <rte_debug.h>
+#include <rte_string_fns.h>
 
 #include "eal_private.h"
 
@@ -211,7 +213,7 @@ rte_bus_find_by_device_name(const char *str)
        char name[RTE_DEV_NAME_MAX_LEN];
        char *c;
 
-       snprintf(name, sizeof(name), "%s", str);
+       strlcpy(name, str, sizeof(name));
        c = strchr(name, ',');
        if (c != NULL)
                c[0] = '\0';