aboutsummaryrefslogtreecommitdiffstats
path: root/lib/librte_cmdline/cmdline_parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/librte_cmdline/cmdline_parse.c')
-rw-r--r--lib/librte_cmdline/cmdline_parse.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/librte_cmdline/cmdline_parse.c b/lib/librte_cmdline/cmdline_parse.c
index e88e4e11..961f9bef 100644
--- a/lib/librte_cmdline/cmdline_parse.c
+++ b/lib/librte_cmdline/cmdline_parse.c
@@ -251,7 +251,7 @@ cmdline_parse(struct cmdline *cl, const char * buf)
}
#ifdef RTE_LIBRTE_CMDLINE_DEBUG
- snprintf(debug_buf, (linelen>64 ? 64 : linelen), "%s", buf);
+ strlcpy(debug_buf, buf, (linelen > 64 ? 64 : linelen));
debug_printf("Parse line : len=%d, <%s>\n", linelen, debug_buf);
#endif
@@ -436,7 +436,7 @@ cmdline_complete(struct cmdline *cl, const char *buf, int *state,
if ((unsigned)(comp_len + 1) > size)
return 0;
- snprintf(dst, size, "%s", comp_buf);
+ strlcpy(dst, comp_buf, size);
dst[comp_len] = 0;
return 2;
}
@@ -513,7 +513,7 @@ cmdline_complete(struct cmdline *cl, const char *buf, int *state,
continue;
}
(*state)++;
- l=snprintf(dst, size, "%s", tmpbuf);
+ l=strlcpy(dst, tmpbuf, size);
if (l>=0 && token_hdr.ops->get_help) {
token_hdr.ops->get_help(token_p, tmpbuf,
sizeof(tmpbuf));