session: fix session formated str output truncated in cli
Type: fix
Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com>
Change-Id: I2c2b739a5aa246bbf53d6663efd403c3aee9dddd
diff --git a/src/vnet/session/application_worker.c b/src/vnet/session/application_worker.c
index 0b2f145..be8a9e8 100644
--- a/src/vnet/session/application_worker.c
+++ b/src/vnet/session/application_worker.c
@@ -723,10 +723,12 @@
if (!app_wrk)
{
if (verbose)
- s = format (s, "%-40s%-25s%-10s%-15s%-15s%-10s", "Connection", "App",
- "Wrk", "API Client", "ListenerID", "SegManager");
+ s = format (s, "%-" SESSION_CLI_ID_LEN "s%-25s%-10s%-15s%-15s%-10s",
+ "Connection", "App", "Wrk", "API Client", "ListenerID",
+ "SegManager");
else
- s = format (s, "%-40s%-25s%-10s", "Connection", "App", "Wrk");
+ s = format (s, "%-" SESSION_CLI_ID_LEN "s%-25s%-10s", "Connection",
+ "App", "Wrk");
return s;
}
@@ -739,12 +741,13 @@
{
u8 *buf;
buf = format (0, "%u(%u)", app_wrk->wrk_map_index, app_wrk->wrk_index);
- s = format (s, "%-40v%-25v%-10v%-15u%-15u%-10u", str, app_name,
- buf, app_wrk->api_client_index, handle, sm_index);
+ s = format (s, "%-" SESSION_CLI_ID_LEN "v%-25v%-10v%-15u%-15u%-10u", str,
+ app_name, buf, app_wrk->api_client_index, handle, sm_index);
vec_free (buf);
}
else
- s = format (s, "%-40v%-25v%=10u", str, app_name, app_wrk->wrk_map_index);
+ s = format (s, "%-" SESSION_CLI_ID_LEN "v%-25v%=10u", str, app_name,
+ app_wrk->wrk_map_index);
vec_free (str);