From 6259381d92c276067390a9ec2dc200b0b4471be4 Mon Sep 17 00:00:00 2001 From: David PHAM-VAN Date: Wed, 23 May 2012 11:59:48 +0200 Subject: [PATCH] Corrected padding in base64 encoding Signed-off-by: Michael Jumper --- libguac/src/socket.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libguac/src/socket.c b/libguac/src/socket.c index 5b1a3f00..e2b9a490 100644 --- a/libguac/src/socket.c +++ b/libguac/src/socket.c @@ -209,13 +209,13 @@ ssize_t __guac_socket_write_base64_triplet(guac_socket* socket, int a, int b, in } -ssize_t __guac_socket_write_base64_byte(guac_socket* socket, char buf) { +ssize_t __guac_socket_write_base64_byte(guac_socket* socket, int buf) { int* __ready_buf = socket->__ready_buf; int retval; - __ready_buf[socket->__ready++] = buf & 0xFF; + __ready_buf[socket->__ready++] = buf; /* Flush triplet */ if (socket->__ready == 3) { @@ -233,8 +233,8 @@ ssize_t guac_socket_write_base64(guac_socket* socket, const void* buf, size_t co int retval; - const char* char_buf = (const char*) buf; - const char* end = char_buf + count; + const unsigned char* char_buf = (const unsigned char*) buf; + const unsigned char* end = char_buf + count; while (char_buf < end) {