summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjiangxiaoming <jiangxiaoming@outlook.com>2020-10-10 15:23:54 +0800
committerFlorin Coras <florin.coras@gmail.com>2020-10-10 18:36:58 +0000
commit6b410e6d7c0f7c8de0453a6e8b19e408b0bd0158 (patch)
tree4a964f4aa0c9f1c6f7dab54760d48cd910ed3a8c
parentc9e9b976d4670b0211806c53eac84678da59b15e (diff)
session: app_name should format with %v
Type: fix Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com> Change-Id: Ib096ad14e6ddbaff52429a416ea4d245703a368d
-rw-r--r--src/vnet/session/application_worker.c6
-rw-r--r--src/vnet/session/segment_manager.c4
2 files changed, 6 insertions, 4 deletions
diff --git a/src/vnet/session/application_worker.c b/src/vnet/session/application_worker.c
index c332f1983ca..662a8003069 100644
--- a/src/vnet/session/application_worker.c
+++ b/src/vnet/session/application_worker.c
@@ -810,12 +810,14 @@ format_app_worker_listener (u8 * s, va_list * args)
{
u8 *buf;
buf = format (0, "%u(%u)", app_wrk->wrk_map_index, app_wrk->wrk_index);
- s = format (s, "%-40s%-25s%=10v%-15u%-15u%-10u", str, app_name,
+ s = format (s, "%-40v%-25v%=10v%-15u%-15u%-10u", str, app_name,
buf, app_wrk->api_client_index, handle, sm_index);
vec_free (buf);
}
else
- s = format (s, "%-40s%-25s%=10u", str, app_name, app_wrk->wrk_map_index);
+ s = format (s, "%-40v%-25v%=10u", str, app_name, app_wrk->wrk_map_index);
+
+ vec_free (str);
return s;
}
diff --git a/src/vnet/session/segment_manager.c b/src/vnet/session/segment_manager.c
index 53be0bfdd76..e00a7616448 100644
--- a/src/vnet/session/segment_manager.c
+++ b/src/vnet/session/segment_manager.c
@@ -1034,10 +1034,10 @@ segment_manager_format_sessions (segment_manager_t * sm, int verbose)
str = format (0, "%U", format_session, session, verbose);
if (verbose)
- s = format (s, "%-40s%-20s%-15u%-10u", str, app_name,
+ s = format (s, "%-40v%-20v%-15u%-10u", str, app_name,
app_wrk->api_client_index, app_wrk->connects_seg_manager);
else
- s = format (s, "%-40s%-20s", str, app_name);
+ s = format (s, "%-40v%-20v", str, app_name);
vlib_cli_output (vm, "%v", s);
vec_reset_length (s);