]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_cmdline/cmdline_parse_ipaddr.c
convert snprintf to strlcpy
[dpdk.git] / lib / librte_cmdline / cmdline_parse_ipaddr.c
index ae6ea1007b74742ca2b4f66944c89cea69747477..d34436abcffcacfa8e7cb02bb1467090d1f101fe 100644 (file)
@@ -277,7 +277,7 @@ cmdline_parse_ipaddr(cmdline_parse_token_hdr_t *tk, const char *buf, void *res,
        if (token_len >= INET6_ADDRSTRLEN+4)
                return -1;
 
-       snprintf(ip_str, token_len+1, "%s", buf);
+       strlcpy(ip_str, buf, token_len + 1);
 
        /* convert the network prefix */
        if (tk2->ipaddr_data.flags & CMDLINE_IPADDR_NETWORK) {