summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2019-09-30 10:56:33 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-10-04 14:23:29 +0000
commitba55df18b5626f71377a8d358d6a146ca39b8706 (patch)
treee747ef20a7785922aa1f7ac2b5bd60237bc6d490 /src
parentf42f1d5db7a503b181c784792d319db3d7eb8d65 (diff)
hsa: fix non-NULL terminated C-string use in echo
Use '%v' format for non-NULL terminated vectors instead of '%s'. Type: fix Change-Id: Id83de52486ad8dad3cdf3f32dad63a223fc1fdf7 Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit bb5ff4e4bb6dbf679a49fc9786718ad6fe229e84)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/hs_apps/sapi/vpp_echo.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/plugins/hs_apps/sapi/vpp_echo.c b/src/plugins/hs_apps/sapi/vpp_echo.c
index 4abc8f6896a..79b71d1611e 100644
--- a/src/plugins/hs_apps/sapi/vpp_echo.c
+++ b/src/plugins/hs_apps/sapi/vpp_echo.c
@@ -124,20 +124,20 @@ print_global_json_stats (echo_main_t * em)
if (start_evt_missing)
ECHO_FAIL (ECHO_FAIL_MISSING_START_EVENT,
- "Expected event %s to happen, but it did not!", start_evt);
+ "Expected event %v to happen, but it did not!", start_evt);
if (end_evt_missing)
ECHO_FAIL (ECHO_FAIL_MISSING_END_EVENT,
- "Expected event %s to happen, but it did not!", end_evt);
+ "Expected event %v to happen, but it did not!", end_evt);
fformat (stdout, "vpp_echo JSON stats:\n{\n");
fformat (stdout, " \"role\": \"%s\",\n",
em->i_am_master ? "server" : "client");
fformat (stdout, " \"time\": \"%.9f\",\n", deltat);
- fformat (stdout, " \"start_evt\": \"%s\",\n", start_evt);
+ fformat (stdout, " \"start_evt\": \"%v\",\n", start_evt);
fformat (stdout, " \"start_evt_missing\": \"%s\",\n",
start_evt_missing ? "True" : "False");
- fformat (stdout, " \"end_evt\": \"%s\",\n", end_evt);
+ fformat (stdout, " \"end_evt\": \"%v\",\n", end_evt);
fformat (stdout, " \"end_evt_missing\": \"%s\",\n",
end_evt_missing ? "True" : "False");
fformat (stdout, " \"rx_data\": %lld,\n", em->stats.rx_total);
@@ -176,17 +176,17 @@ print_global_stats (echo_main_t * em)
if (start_evt_missing)
ECHO_FAIL (ECHO_FAIL_MISSING_START_EVENT,
- "Expected event %s to happen, but it did not!", start_evt);
+ "Expected event %v to happen, but it did not!", start_evt);
if (end_evt_missing)
ECHO_FAIL (ECHO_FAIL_MISSING_END_EVENT,
- "Expected event %s to happen, but it did not!", end_evt);
+ "Expected event %v to happen, but it did not!", end_evt);
- fformat (stdout, "Timing %s:%s\n", start_evt, end_evt);
+ fformat (stdout, "Timing %v:%v\n", start_evt, end_evt);
if (start_evt_missing)
- fformat (stdout, "Missing Start Timing Event (%s)!\n", start_evt);
+ fformat (stdout, "Missing Start Timing Event (%v)!\n", start_evt);
if (end_evt_missing)
- fformat (stdout, "Missing End Timing Event (%s)!\n", end_evt);
+ fformat (stdout, "Missing End Timing Event (%v)!\n", end_evt);
fformat (stdout, "-------- TX --------\n");
fformat (stdout, "%lld bytes (%lld mbytes, %lld gbytes) in %.6f seconds\n",
em->stats.tx_total, em->stats.tx_total / (1ULL << 20),