X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf%2Fctf.c;h=ea760f0e0725aecf7d53e719e8492374834b0491;hp=3ce428c387681db74cefadffd0f861daad43aba0;hb=7e18eedf5333dbd6f1e0a8d873a7275dee1ed396;hpb=e669e45e7fdff6b855907cde40524ebf4cc8a3bc diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 3ce428c3..ea760f0e 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -1185,14 +1185,14 @@ int create_stream_packet_index(struct ctf_trace *td, /* Validate content size and packet size values */ if (packet_index.content_size > packet_index.packet_size) { - fprintf(stderr, "[error] Content size (%zu bits) is larger than packet size (%zu bits).\n", + fprintf(stderr, "[error] Content size (%" PRIu64 " bits) is larger than packet size (%" PRIu64 " bits).\n", packet_index.content_size, packet_index.packet_size); return -EINVAL; } - if (packet_index.packet_size > (filestats.st_size - packet_index.offset) * CHAR_BIT) { - fprintf(stderr, "[error] Packet size (%zu bits) is larger than remaining file size (%zu bits).\n", - packet_index.content_size, (size_t) (filestats.st_size - packet_index.offset) * CHAR_BIT); + if (packet_index.packet_size > ((uint64_t)filestats.st_size - packet_index.offset) * CHAR_BIT) { + fprintf(stderr, "[error] Packet size (%" PRIu64 " bits) is larger than remaining file size (%" PRIu64 " bits).\n", + packet_index.content_size, ((uint64_t)filestats.st_size - packet_index.offset) * CHAR_BIT); return -EINVAL; }