X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf%2Fctf.c;h=687e360e1699e87bb1b8eba7b7077bf2d48fe388;hp=db6615b48dcaffe4c5b5b1f6925457e254d44ac8;hb=3dd513bb4187aa06c6a0e773a00efd5e44bbd82b;hpb=4d251e2240975c1b35092545a547b64a881f0174 diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index db6615b4..687e360e 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -1486,28 +1486,28 @@ begin: fprintf(stderr, "[error] Unable to read packet context: %s\n", strerror(-ret)); return ret; } - /* read content size from header */ - len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("content_size")); + /* read packet size from header */ + len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("packet_size")); if (len_index >= 0) { struct bt_definition *field; field = bt_struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index); - packet_index.content_size = bt_get_unsigned_int(field); + packet_index.packet_size = bt_get_unsigned_int(field); } else { /* Use file size for packet size */ - packet_index.content_size = filesize * CHAR_BIT; + packet_index.packet_size = filesize * CHAR_BIT; } - /* read packet size from header */ - len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("packet_size")); + /* read content size from header */ + len_index = bt_struct_declaration_lookup_field_index(file_stream->parent.stream_packet_context->declaration, g_quark_from_static_string("content_size")); if (len_index >= 0) { struct bt_definition *field; field = bt_struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index); - packet_index.packet_size = bt_get_unsigned_int(field); + packet_index.content_size = bt_get_unsigned_int(field); } else { - /* Use content size if non-zero, else file size */ - packet_index.packet_size = packet_index.content_size ? : filesize * CHAR_BIT; + /* Use packet size if non-zero, else file size */ + packet_index.content_size = packet_index.packet_size ? : filesize * CHAR_BIT; } /* read timestamp begin from header */