From 34b449d2b06e9887995d216685f9e62f6da37303 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 6 Aug 2016 17:34:49 +0200 Subject: Fix error recv bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libcoopgamma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libcoopgamma.c b/src/libcoopgamma.c index 387e698..2ca0a32 100644 --- a/src/libcoopgamma.c +++ b/src/libcoopgamma.c @@ -1855,6 +1855,7 @@ static int check_error(libcoopgamma_context_t* restrict ctx, libcoopgamma_async_ bad = 1; continue; } + value += 7; } ctx->error.number = (uint64_t)atoll(value); sprintf(temp, "%" PRIu64, ctx->error.number); @@ -1872,7 +1873,7 @@ static int check_error(libcoopgamma_context_t* restrict ctx, libcoopgamma_async_ payload = next_payload(ctx, &n); if (payload != NULL) { - if (memchr(ctx, '\0', n) || (payload[n - 1] != '\n')) + if (memchr(payload, '\0', n) || (payload[n - 1] != '\n')) goto badmsg; ctx->error.description = malloc(n); if (ctx->error.description == NULL) -- cgit v1.2.3-70-g09d2