diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2018-11-02 14:09:23 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2018-11-02 14:09:23 +0100 |
commit | 8848b0e22aaba6f3d7116c7137ede3b43f393a85 (patch) | |
tree | 65ffb8531d608f899bffcd47bc8721ec059cdc26 /src/plugins/relay | |
parent | 74a17d821f066c41f1450e9fae805c1711482265 (diff) | |
download | weechat-8848b0e22aaba6f3d7116c7137ede3b43f393a85.zip |
api: return integer in function string_encode_base64
Diffstat (limited to 'src/plugins/relay')
-rw-r--r-- | src/plugins/relay/relay-websocket.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/relay/relay-websocket.c b/src/plugins/relay/relay-websocket.c index bbac751dc..60c4f4526 100644 --- a/src/plugins/relay/relay-websocket.c +++ b/src/plugins/relay/relay-websocket.c @@ -214,7 +214,11 @@ relay_websocket_build_handshake (struct t_relay_client *client) length = gcry_md_get_algo_dlen (GCRY_MD_SHA1); gcry_md_write (hd, key, strlen (key)); result = gcry_md_read (hd, GCRY_MD_SHA1); - weechat_string_encode_base64 ((char *)result, length, sec_websocket_accept); + if (weechat_string_encode_base64 ((char *)result, length, + sec_websocket_accept) < 0) + { + sec_websocket_accept[0] = '\0'; + } gcry_md_close (hd); free (key); |