summaryrefslogtreecommitdiff
path: root/network
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2013-07-28 19:01:34 +0200
committerSebastian Dröge <slomo@circular-chaos.org>2013-07-28 19:01:34 +0200
commitdcf3da3d5d98771b45c871965e07c9045d0dbdcd (patch)
treeb094478fca959a8f2458a6757cbec5d906ebd213 /network
parentc8a308eee2664b6c0e6ec3341f6b2a3590155db1 (diff)
network/http-launch: Append \0 at the end of the requests to make the string functions happy
Diffstat (limited to 'network')
-rw-r--r--network/http-launch/http-launch.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/network/http-launch/http-launch.c b/network/http-launch/http-launch.c
index 5d741e2..4ab7a27 100644
--- a/network/http-launch/http-launch.c
+++ b/network/http-launch/http-launch.c
@@ -208,8 +208,10 @@ on_read_bytes (GPollableInputStream * stream, Client * client)
while (client->current_message->len > 3) {
if (tmp[0] == 0x0d && tmp[1] == 0x0a && tmp[2] == 0x0d && tmp[3] == 0x0a) {
- guint len = tmp - client->current_message->data + 4;
+ guint len;
+ g_byte_array_append (client->current_message, (const guint8 *) "\0", 1);
+ len = tmp - client->current_message->data + 5;
client_message (client, (gchar *) client->current_message->data, len);
g_byte_array_remove_range (client->current_message, 0, len);
tmp = client->current_message->data;