]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_cmdline/cmdline_parse_portlist.c
doc: add Meson coding style to contributors guide
[dpdk.git] / lib / librte_cmdline / cmdline_parse_portlist.c
index 5952f34389721939e9e4a86bd9c4f3a154bda167..e1aa07be4b3300c26cfa795c05657b7538751aa7 100644 (file)
@@ -72,7 +72,7 @@ parse_ports(cmdline_portlist_t *pl, const char *str)
 }
 
 int
-cmdline_parse_portlist(__attribute__((unused)) cmdline_parse_token_hdr_t *tk,
+cmdline_parse_portlist(__rte_unused cmdline_parse_token_hdr_t *tk,
        const char *buf, void *res, unsigned ressize)
 {
        unsigned int token_len = 0;
@@ -94,7 +94,7 @@ cmdline_parse_portlist(__attribute__((unused)) cmdline_parse_token_hdr_t *tk,
        if (token_len >= PORTLIST_TOKEN_SIZE)
                return -1;
 
-       snprintf(portlist_str, token_len+1, "%s", buf);
+       strlcpy(portlist_str, buf, token_len + 1);
 
        if (pl) {
                pl->map = 0;
@@ -108,7 +108,7 @@ cmdline_parse_portlist(__attribute__((unused)) cmdline_parse_token_hdr_t *tk,
 }
 
 int
-cmdline_get_help_portlist(__attribute__((unused)) cmdline_parse_token_hdr_t *tk,
+cmdline_get_help_portlist(__rte_unused cmdline_parse_token_hdr_t *tk,
                char *dstbuf, unsigned int size)
 {
        int ret;