From 61579bd9b7de0ec6cb12baa1527f269d4e92eac1 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sat, 26 Nov 2011 00:28:43 -0800 Subject: [PATCH] Fix library name generation, fix instruction parsing. --- libguac/src/client.c | 4 ++++ libguac/src/protocol.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libguac/src/client.c b/libguac/src/client.c index 0ad18a27..db53b224 100644 --- a/libguac/src/client.c +++ b/libguac/src/client.c @@ -127,6 +127,10 @@ guac_client_plugin* guac_client_plugin_open(const char* protocol) { void* obj; } alias; + /* Add protocol and .so suffix to protocol_lib */ + strcat(protocol_lib, protocol); + strcat(protocol_lib, ".so"); + /* Load client plugin */ client_plugin_handle = dlopen(protocol_lib, RTLD_LAZY); if (!client_plugin_handle) { diff --git a/libguac/src/protocol.c b/libguac/src/protocol.c index 3585b3c8..e80d94c7 100644 --- a/libguac/src/protocol.c +++ b/libguac/src/protocol.c @@ -461,8 +461,8 @@ guac_instruction* guac_protocol_read_instruction(guac_socket* socket, int usec_t } /* Reset buffer */ - memmove(socket->__instructionbuf, socket->__instructionbuf + i + 1, socket->__instructionbuf_used_length - i - 1); - socket->__instructionbuf_used_length -= i + 1; + memmove(socket->__instructionbuf, socket->__instructionbuf + i, socket->__instructionbuf_used_length - i); + socket->__instructionbuf_used_length -= i; socket->__instructionbuf_parse_start = 0; socket->__instructionbuf_elementc = 0;