[dpdk-dev] [PATCH v1] lib/cmdline: init parse result memory
olivier.matz at 6wind.com
Fri Dec 8 14:51:15 CET 2017
On Fri, Dec 08, 2017 at 01:27:26PM +0100, Adrien Mazarguil wrote:
> On Fri, Dec 08, 2017 at 03:02:44PM +0800, Xueming Li wrote:
> > Initialize binary result memory before parsing to avoid garbage in
> > parsing result.
> > Signed-off-by: Xueming Li <xuemingl at mellanox.com>
> Since you chose to move the break statement, maybe the original commit
> mentioned in my previous message (9b3fbb051d2e "cmdline: fix parsing") can
> be reverted afterward? I think it makes tmp_result redundant.
> Wenzhuo, as the author of that commit, can you confirm?
> Olivier, no problem with breaking the loop immediately after the first
> successful match_inst() call instead of the last one? (I don't see why it
> would be an issue but I may have missed something)
Moving the break will change the behavior, it will never detect
ambiguous commands (i.e when several commands match the same input).
So I think we should not do it.
IMO, only the memset() is enough.
More information about the dev