From: Mathieu Desnoyers Date: Wed, 8 Jun 2011 21:01:44 +0000 (-0400) Subject: Packet metadata read should substract header size X-Git-Tag: v0.1~13 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=255b2138aafa746f08e410e1f239165cec43edaf Packet metadata read should substract header size Signed-off-by: Mathieu Desnoyers --- diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index adff1eb7..dc7baf5a 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -508,7 +508,7 @@ int ctf_open_trace_metadata_packet_read(struct ctf_trace *td, FILE *in, return -EINVAL; } - toread = header.content_size / CHAR_BIT; + toread = (header.content_size / CHAR_BIT) - header_sizeof(header); for (;;) { readlen = fread(buf, sizeof(char), min(sizeof(buf), toread), in);