From 300f5731a568d23c09be9bd6e352e2883a3f4573 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 17 Aug 2016 21:56:31 +0200 Subject: Fix bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/servers/coopgamma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/servers/coopgamma.c b/src/servers/coopgamma.c index b96df10..6e544be 100644 --- a/src/servers/coopgamma.c +++ b/src/servers/coopgamma.c @@ -342,8 +342,8 @@ int handle_get_gamma(size_t conn, const char* restrict message_id, const char* r if (coal) { - if (start == 0) - memcpy(buf + n, output->table_sums[end].u8.red, output->ramps_size); + if ((start == 0) && (start < end)) + memcpy(buf + n, output->table_sums[end - 1].u8.red, output->ramps_size); else { union gamma_ramps ramps; -- cgit v1.2.3-70-g09d2