X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_cmdline%2Fcmdline_parse_num.c;h=478f181b444370914c4abd7f728df076342cb780;hb=cdfa0dc1702bcfe6c403d3cfe4046b29c8e6c5b9;hp=55c7a81489410bf643e77fea1f302779c5e81df4;hpb=add6c87ebe9337c66c3009f458c48fbccb727558;p=dpdk.git diff --git a/lib/librte_cmdline/cmdline_parse_num.c b/lib/librte_cmdline/cmdline_parse_num.c index 55c7a81489..478f181b44 100644 --- a/lib/librte_cmdline/cmdline_parse_num.c +++ b/lib/librte_cmdline/cmdline_parse_num.c @@ -196,7 +196,7 @@ cmdline_parse_num(cmdline_parse_token_hdr_t *tk, const char *srcbuf, void *res, case HEX: st = HEX_OK; - /* fall-through no break */ + /* fall-through */ case HEX_OK: if (c >= '0' && c <= '9') { if (add_to_res(c - '0', &res1, 16) < 0) @@ -340,7 +340,7 @@ cmdline_get_help_num(cmdline_parse_token_hdr_t *tk, char *dstbuf, unsigned int s /* if (nd.type >= (sizeof(num_help)/sizeof(const char *))) */ /* return -1; */ - ret = snprintf(dstbuf, size, "%s", num_help[nd.type]); + ret = strlcpy(dstbuf, num_help[nd.type], size); if (ret < 0) return -1; dstbuf[size-1] = '\0';