From: Andrew Yourtchenko Date: Mon, 21 Jan 2019 15:39:33 +0000 (+0100) Subject: vlib: fix "foo_msg" and "foo_msg_reply" in API message table triggering the "definini... X-Git-Tag: v19.04-rc1~42 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=ae605b89035b26248f245597291474be6ae8ec5e;p=vpp.git vlib: fix "foo_msg" and "foo_msg_reply" in API message table triggering the "defininion changed" output strncmp() succeeds if the i+1th message is "foo_reply", because the comparison terminates early after "foo" - which triggers the "definition changed" rather than "only in ..." message. Fix also the case where i+1th element does not exist. Change-Id: I127136410491d9dd102e160fd831fcf6f0bd3a9f Signed-off-by: Andrew Yourtchenko --- diff --git a/src/vlibmemory/vlib_api_cli.c b/src/vlibmemory/vlib_api_cli.c index 4c55292ad6d..2d8d4077871 100755 --- a/src/vlibmemory/vlib_api_cli.c +++ b/src/vlibmemory/vlib_api_cli.c @@ -1114,8 +1114,8 @@ dump_api_table_file_command_fn (vlib_main_t * vm, ndifferences++; /* Only in one of two tables? */ - if (strncmp ((char *) table[i].name, (char *) table[i + 1].name, - vec_len (table[i].name))) + if (i + 1 == vec_len (table) + || strcmp ((char *) table[i].name, (char *) table[i + 1].name)) { last_unique: vlib_cli_output (vm, "%-60s only in %s",