]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_cmdline/cmdline_parse_num.c
replace snprintf with strlcpy without adding extra include
[dpdk.git] / lib / librte_cmdline / cmdline_parse_num.c
index 55c7a81489410bf643e77fea1f302779c5e81df4..182ac12f02a70ad29a5efe110cfe5da39166d2e2 100644 (file)
@@ -340,7 +340,7 @@ cmdline_get_help_num(cmdline_parse_token_hdr_t *tk, char *dstbuf, unsigned int s
        /* if (nd.type >= (sizeof(num_help)/sizeof(const char *))) */
        /* return -1; */
 
-       ret = snprintf(dstbuf, size, "%s", num_help[nd.type]);
+       ret = strlcpy(dstbuf, num_help[nd.type], size);
        if (ret < 0)
                return -1;
        dstbuf[size-1] = '\0';