Fix reading of empty packets
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 2 Aug 2011 20:34:01 +0000 (16:34 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 2 Aug 2011 20:34:01 +0000 (16:34 -0400)
Prior to this fix, an empty packet would be considered as an end of
file. (off-by-one in the size comparison)

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/ctf.c

index 021abf88891c6c0ff7dc62beedde1444a162f061..7120207ddb5a47dafeb50089b13f1c542563ea7e 100644 (file)
@@ -415,9 +415,9 @@ void ctf_move_pos_slow(struct ctf_stream_pos *pos, size_t offset, int whence)
                file_stream->parent.timestamp = index->timestamp_begin;
                pos->content_size = index->content_size;
                pos->packet_size = index->packet_size;
-               if (index->data_offset < index->content_size)
+               if (index->data_offset <= index->content_size) {
                        pos->offset = 0;        /* will read headers */
-               else {
+               else {
                        pos->offset = EOF;
                        return;
                }
This page took 0.025399 seconds and 4 git commands to generate.