diff options
author | Ole Troan <ot@cisco.com> | 2018-12-16 23:44:54 +0100 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2018-12-17 08:48:24 +0000 |
commit | d6e9aecfd67ebfd012873eb24b72221f13e8f089 (patch) | |
tree | c5ccdf2a6b130f57c2f12873ede595e8e38b4fc5 /src/vat | |
parent | 3c7d4f9e1f54ec6627795b64525f182e2cda7490 (diff) |
String type: Not include \0 in show_version
The string type does not include the \0 in strings.
Change-Id: I869f438b84880df40a018e43b4510194d84ce0fe
Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vat')
-rw-r--r-- | src/vat/api_format.c | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/src/vat/api_format.c b/src/vat/api_format.c index f7e076764aa..4c43fcfaa20 100644 --- a/src/vat/api_format.c +++ b/src/vat/api_format.c @@ -1302,18 +1302,30 @@ static void vl_api_show_version_reply_t_handler if (retval >= 0) { + char *s; char *p = (char *) &mp->program; - errmsg (" program: %s\n", - vl_api_from_api_string ((vl_api_string_t *) p)); - p += vl_api_string_len ((vl_api_string_t *) p) + sizeof (u32); - errmsg (" version: %s\n", - vl_api_from_api_string ((vl_api_string_t *) p)); - p += vl_api_string_len ((vl_api_string_t *) p) + sizeof (u32); - errmsg (" build date: %s\n", - vl_api_from_api_string ((vl_api_string_t *) p)); - p += vl_api_string_len ((vl_api_string_t *) p) + sizeof (u32); - errmsg ("build directory: %s\n", - vl_api_from_api_string ((vl_api_string_t *) p)); + + s = vl_api_from_api_string_c ((vl_api_string_t *) p); + errmsg (" program: %s\n", s); + free (s); + + p += + vl_api_string_len ((vl_api_string_t *) p) + sizeof (vl_api_string_t); + s = vl_api_from_api_string_c ((vl_api_string_t *) p); + errmsg (" version: %s\n", s); + free (s); + + p += + vl_api_string_len ((vl_api_string_t *) p) + sizeof (vl_api_string_t); + s = vl_api_from_api_string_c ((vl_api_string_t *) p); + errmsg (" build date: %s\n", s); + free (s); + + p += + vl_api_string_len ((vl_api_string_t *) p) + sizeof (vl_api_string_t); + s = vl_api_from_api_string_c ((vl_api_string_t *) p); + errmsg ("build directory: %s\n", s); + free (s); } vam->retval = retval; vam->result_ready = 1; |