diff options
author | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2018-06-01 09:09:08 +0200 |
---|---|---|
committer | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2018-06-01 09:12:07 +0200 |
commit | 1bd9b61222f3a81ffe770fc00b70ded6e760c42b (patch) | |
tree | 0bf7d996cf0664796687c1be6d22958fcf6a8096 /lib/librte_cmdline/cmdline_parse.c | |
parent | bb4e158029645f37809fcf81a3acddd6fa11f88a (diff) |
New upstream version 18.05
Change-Id: Icd4170ddc4f63aeae5d0559490e5195b5349f9c2
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'lib/librte_cmdline/cmdline_parse.c')
-rw-r--r-- | lib/librte_cmdline/cmdline_parse.c | 6 |
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)); |