From: Michael Vrable Date: Fri, 21 Jan 2011 00:34:59 +0000 (-0800) Subject: Fix off-by-one error in the BlueSky simple storage backend. X-Git-Url: https://git.vrable.net/?a=commitdiff_plain;h=3545d572eecff2a6e0ad53bfae3ed0c35f232cbe;p=bluesky.git Fix off-by-one error in the BlueSky simple storage backend. One extra byte of data was being included into the data returned, leading to data corruption. Fix this. --- diff --git a/bluesky/store-simple.c b/bluesky/store-simple.c index ef68e11..25eef53 100644 --- a/bluesky/store-simple.c +++ b/bluesky/store-simple.c @@ -143,7 +143,7 @@ static void simplestore_task(gpointer a, gpointer b) char *data = g_malloc(result); if (strchr(result_buf, '\n') != NULL) { - int header_size = strchr(result_buf, '\n') - result_buf; + int header_size = strchr(result_buf, '\n') - result_buf + 1; int data_bytes = bytes - header_size; if (data_bytes > result) data_bytes = result;