aboutsummaryrefslogtreecommitdiffstats
path: root/lib/librte_cmdline/cmdline_parse_string.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/librte_cmdline/cmdline_parse_string.c')
-rw-r--r--lib/librte_cmdline/cmdline_parse_string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/librte_cmdline/cmdline_parse_string.c b/lib/librte_cmdline/cmdline_parse_string.c
index abde0412..9cf41d0f 100644
--- a/lib/librte_cmdline/cmdline_parse_string.c
+++ b/lib/librte_cmdline/cmdline_parse_string.c
@@ -125,10 +125,10 @@ cmdline_parse_string(cmdline_parse_token_hdr_t *tk, const char *buf, void *res,
if (res) {
if ((sd->str != NULL) && (strcmp(sd->str, TOKEN_STRING_MULTI) == 0))
/* we are sure that token_len is < STR_MULTI_TOKEN_SIZE-1 */
- snprintf(res, STR_MULTI_TOKEN_SIZE, "%s", buf);
+ strlcpy(res, buf, STR_MULTI_TOKEN_SIZE);
else
/* we are sure that token_len is < STR_TOKEN_SIZE-1 */
- snprintf(res, STR_TOKEN_SIZE, "%s", buf);
+ strlcpy(res, buf, STR_TOKEN_SIZE);
*((char *)res + token_len) = 0;
}