replace snprintf with strlcpy without adding extra include
[dpdk.git] / lib / librte_cmdline / cmdline_parse_num.c
index 55c7a81..182ac12 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';