ci: enable unit test for aarch64
[dpdk.git] / lib / librte_cmdline / cmdline_parse.c
index 961f9be..b57b30e 100644 (file)
@@ -208,9 +208,6 @@ cmdline_parse(struct cmdline *cl, const char * buf)
        int err = CMDLINE_PARSE_NOMATCH;
        int tok;
        cmdline_parse_ctx_t *ctx;
-#ifdef RTE_LIBRTE_CMDLINE_DEBUG
-       char debug_buf[BUFSIZ];
-#endif
        char *result_buf = result.buf;
 
        if (!cl || !buf)
@@ -250,10 +247,8 @@ cmdline_parse(struct cmdline *cl, const char * buf)
                return linelen;
        }
 
-#ifdef RTE_LIBRTE_CMDLINE_DEBUG
-       strlcpy(debug_buf, buf, (linelen > 64 ? 64 : linelen));
-       debug_printf("Parse line : len=%d, <%s>\n", linelen, debug_buf);
-#endif
+       debug_printf("Parse line : len=%d, <%.*s>\n",
+                    linelen, linelen > 64 ? 64 : linelen, buf);
 
        /* parse it !! */
        inst = ctx[inst_num];
@@ -399,8 +394,9 @@ cmdline_complete(struct cmdline *cl, const char *buf, int *state,
                                if (!strncmp(partial_tok, tmpbuf,
                                             partial_tok_len)) {
                                        if (comp_len == -1) {
-                                               snprintf(comp_buf, sizeof(comp_buf),
-                                                        "%s", tmpbuf + partial_tok_len);
+                                               strlcpy(comp_buf,
+                                                       tmpbuf + partial_tok_len,
+                                                       sizeof(comp_buf));
                                                comp_len =
                                                        strnlen(tmpbuf + partial_tok_len,
                                                                        sizeof(tmpbuf) - partial_tok_len);