diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2017-02-06 20:11:29 +0100 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2017-02-06 20:11:29 +0100 |
commit | 6017ce464d9e53506500ef0219fd5b5b3f84d4cd (patch) | |
tree | 225268491ffd70b1957f486b8753cf7bab1a7d0a | |
parent | 118d3318eebb71a43ccdcfda7a80798edff98f6d (diff) | |
download | json-rpc-shell-6017ce464d9e53506500ef0219fd5b5b3f84d4cd.tar.gz json-rpc-shell-6017ce464d9e53506500ef0219fd5b5b3f84d4cd.tar.xz json-rpc-shell-6017ce464d9e53506500ef0219fd5b5b3f84d4cd.zip |
WebSocket: fix showing the close reason
-rw-r--r-- | json-rpc-shell.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/json-rpc-shell.c b/json-rpc-shell.c index 09c4d82..9b5c4f7 100644 --- a/json-rpc-shell.c +++ b/json-rpc-shell.c @@ -1909,7 +1909,7 @@ backend_ws_finish_closing_handshake } char *s = iconv_xstrdup (self->ctx->term_from_utf8, - reason.str, reason.len, NULL); + reason.str, reason.len + 1 /* null byte */, NULL); print_status ("server closed the connection (%s)", s); str_free (&reason); free (s); @@ -2932,7 +2932,7 @@ make_json_rpc_call (struct app_context *ctx, if (!success) { char *s = iconv_xstrdup (ctx->term_from_utf8, - buf.str, buf.len + 1, NULL); + buf.str, buf.len + 1 /* null byte */, NULL); if (!s) print_error ("character conversion failed for `%s'", "raw response data"); |