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;