From 37aea2d35c981239e630254fe74f0a411bbc34cb Mon Sep 17 00:00:00 2001 From: Bert Vermeulen Date: Thu, 8 Apr 2010 16:42:22 +0200 Subject: [PATCH] better buffer size calculation --- output/output_text.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/output/output_text.c b/output/output_text.c index bc761771..c4b9c95d 100644 --- a/output/output_text.c +++ b/output/output_text.c @@ -151,7 +151,7 @@ static int data_binary(struct output *o, char *data_in, uint64_t length_in, char char *outbuf; ctx = o->internal; - outsize = length_in / ctx->unitsize * ctx->num_enabled_probes * 3 + 512; + outsize = length_in / ctx->unitsize * ctx->num_enabled_probes * ctx->samples_per_line + 512; outbuf = calloc(1, outsize+1); if(ctx->header) { /* the header is still in here, we must be on the first data packet */ @@ -213,7 +213,7 @@ static int data_hex(struct output *o, char *data_in, uint64_t length_in, char ** char *outbuf; ctx = o->internal; - outsize = length_in / ctx->unitsize * ctx->num_enabled_probes * 3 + 512; + outsize = length_in / ctx->unitsize * ctx->num_enabled_probes * ctx->samples_per_line + 512; outbuf = calloc(1, outsize+1); if(ctx->header) { /* the header is still in here, we must be on the first data packet */