/* 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;
}
struct packet_index {
off_t offset; /* offset of the packet in the file, in bytes */
off_t data_offset; /* offset of data within the packet, in bits */
- size_t packet_size; /* packet size, in bits */
- size_t content_size; /* content size, in bits */
+ uint64_t packet_size; /* packet size, in bits */
+ uint64_t content_size; /* content size, in bits */
uint64_t timestamp_begin;
uint64_t timestamp_end;
uint32_t events_discarded;