diff options
author | Ole Troan <ot@cisco.com> | 2019-08-22 09:02:59 +0200 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2019-08-27 07:51:55 +0000 |
commit | 2959d42feb576c0e00c28c4e27658b25f6c783e9 (patch) | |
tree | 9b1e3474eb835b4fac2e3edfbcbda9a02a8cc730 /src/vlibmemory/socket_client.c | |
parent | 3f1964d2d2847c5307694fe8daea0a7eef1e2733 (diff) |
api: use string type for strings in memclnt.api
Explicitly using string type in API allows for autogenerating tools to print
strings instead of hex-dumping byte strings.
Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I573962d6b34d5d10aab9dc6a5fdf101c9b12a6a6
Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vlibmemory/socket_client.c')
-rw-r--r-- | src/vlibmemory/socket_client.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vlibmemory/socket_client.c b/src/vlibmemory/socket_client.c index 96330ce481a..fcd31992fa5 100644 --- a/src/vlibmemory/socket_client.c +++ b/src/vlibmemory/socket_client.c @@ -395,8 +395,8 @@ vl_socket_client_connect (char *socket_path, char *client_name, mp = vl_socket_client_msg_alloc (sizeof (*mp)); mp->_vl_msg_id = htons (VL_API_SOCKCLNT_CREATE); - strncpy ((char *) mp->name, client_name, sizeof (mp->name) - 1); - mp->name[sizeof (mp->name) - 1] = 0; + + vl_api_to_api_string (strnlen_s (client_name, 64), client_name, &mp->name); mp->context = 0xfeedface; clib_time_init (&scm->clib_time); |