output_text: Allocate more memory for output

The trigger line was forgotten. Allocate 512 bytes extra.
This commit is contained in:
Håvard Espeland 2011-01-15 18:24:01 +01:00
parent 9996570987
commit 9d7ab9ba3b
1 changed files with 5 additions and 1 deletions

View File

@ -194,7 +194,11 @@ static int data_bits(struct output *o, char *data_in, uint64_t length_in,
ctx = o->internal;
max_linelen = MAX_PROBENAME_LEN + 3 + ctx->samples_per_line
+ ctx->samples_per_line / 8;
outsize = (1 + (length_in / ctx->unitsize) / ctx->samples_per_line)
/*
* Calculate space needed for probes. Set aside 512 bytes for
* extra output, e.g. trigger.
*/
outsize = 512 + (1 + (length_in / ctx->unitsize) / ctx->samples_per_line)
* (ctx->num_enabled_probes * max_linelen);
if (!(outbuf = calloc(1, outsize + 1)))