Packet metadata read should substract header size
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 8 Jun 2011 21:01:44 +0000 (17:01 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 8 Jun 2011 21:01:44 +0000 (17:01 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/ctf.c

index adff1eb7ce86cd0a1e158fd49777175f454d3633..dc7baf5a891621f726df12a37cc472926208b8aa 100644 (file)
@@ -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);
This page took 0.033792 seconds and 4 git commands to generate.