X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Flibrte_cmdline%2Fcmdline_parse_string.c;h=9cf41d0f76b4006dd518ec5b7a2d0ff7ece26f23;hb=c50a1d91a5398a8be584450cd7f50b0b963aba3c;hp=abde0412ac947b7880e1b41f700de07f4f70cd91;hpb=add6c87ebe9337c66c3009f458c48fbccb727558;p=dpdk.git diff --git a/lib/librte_cmdline/cmdline_parse_string.c b/lib/librte_cmdline/cmdline_parse_string.c index abde0412ac..9cf41d0f76 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; }