output_text: Allocate enough memory for output
This commit is contained in:
parent
858fb11c5e
commit
3aa403e858
|
@ -194,8 +194,8 @@ static int data_bits(struct output *o, char *data_in, uint64_t length_in,
|
||||||
ctx = o->internal;
|
ctx = o->internal;
|
||||||
max_linelen = MAX_PROBENAME_LEN + 3 + ctx->samples_per_line
|
max_linelen = MAX_PROBENAME_LEN + 3 + ctx->samples_per_line
|
||||||
+ ctx->samples_per_line / 8;
|
+ ctx->samples_per_line / 8;
|
||||||
outsize = length_in / ctx->unitsize * ctx->num_enabled_probes
|
outsize = (1 + (length_in / ctx->unitsize) / ctx->samples_per_line)
|
||||||
/ ctx->samples_per_line * max_linelen + 512;
|
* (ctx->num_enabled_probes * max_linelen);
|
||||||
|
|
||||||
if (!(outbuf = calloc(1, outsize + 1)))
|
if (!(outbuf = calloc(1, outsize + 1)))
|
||||||
return SIGROK_ERR_MALLOC;
|
return SIGROK_ERR_MALLOC;
|
||||||
|
|
Loading…
Reference in New Issue