* Well, we have padding; how much?
*/
padbytes = g_ntohl(rec_hdr.rec_len) -
- (sizeof rec_hdr + g_ntohl(rec_hdr.incl_len));
+ ((guint)sizeof rec_hdr + g_ntohl(rec_hdr.incl_len));
/*
* Is it at least the size of a Shomiti trailer?
* have a pseudo-header.
*/
*err = WTAP_ERR_BAD_RECORD;
- *err_info = g_strdup_printf("snoop: atmsnoop file has a %u-byte packet, too small to have even an ATM pseudo-header\n",
+ *err_info = g_strdup_printf("snoop: atmsnoop file has a %u-byte packet, too small to have even an ATM pseudo-header",
packet_size);
return FALSE;
}
/*
* Don't count the pseudo-header as part of the packet.
*/
- rec_size -= sizeof (struct snoop_atm_hdr);
- orig_size -= sizeof (struct snoop_atm_hdr);
- packet_size -= sizeof (struct snoop_atm_hdr);
+ rec_size -= (guint32)sizeof (struct snoop_atm_hdr);
+ orig_size -= (guint32)sizeof (struct snoop_atm_hdr);
+ packet_size -= (guint32)sizeof (struct snoop_atm_hdr);
wth->data_offset += sizeof (struct snoop_atm_hdr);
break;
* have a pseudo-header.
*/
*err = WTAP_ERR_BAD_RECORD;
- *err_info = g_strdup_printf("snoop: Shomiti wireless file has a %u-byte packet, too small to have even a wireless pseudo-header\n",
+ *err_info = g_strdup_printf("snoop: Shomiti wireless file has a %u-byte packet, too small to have even a wireless pseudo-header",
packet_size);
return FALSE;
}
/*
* Don't count the pseudo-header as part of the packet.
*/
- rec_size -= sizeof (shomiti_wireless_header);
- orig_size -= sizeof (shomiti_wireless_header);
- packet_size -= sizeof (shomiti_wireless_header);
+ rec_size -= (guint32)sizeof (shomiti_wireless_header);
+ orig_size -= (guint32)sizeof (shomiti_wireless_header);
+ packet_size -= (guint32)sizeof (shomiti_wireless_header);
wth->data_offset += sizeof (shomiti_wireless_header);
break;
}
rec_size, packet_size);
return FALSE;
}
- padbytes = rec_size - (sizeof hdr + packet_size);
+ padbytes = rec_size - ((guint)sizeof hdr + packet_size);
while (padbytes != 0) {
bytes_to_read = padbytes;
if ((unsigned)bytes_to_read > sizeof padbuf)
atm_hdrsize = 0;
/* Record length = header length plus data length... */
- reclen = sizeof rec_hdr + phdr->caplen + atm_hdrsize;
+ reclen = (int)sizeof rec_hdr + phdr->caplen + atm_hdrsize;
/* ... plus enough bytes to pad it to a 4-byte boundary. */
padlen = ((reclen + 3) & ~3) - reclen;