aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/cosine.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2021-01-19 19:02:01 -0800
committerGuy Harris <gharris@sonic.net>2021-01-19 19:02:01 -0800
commit64f1d09ef332511e3caf17fb5943c404c55df5fd (patch)
tree73cce04c29ca4a41cb0d2ca0b6aae4a05fccfa68 /wiretap/cosine.c
parent6db087ae4b67b9c1f6e193ce3b7606345988d51d (diff)
downloadwireshark-64f1d09ef332511e3caf17fb5943c404c55df5fd.tar.gz
wireshark-64f1d09ef332511e3caf17fb5943c404c55df5fd.tar.bz2
wireshark-64f1d09ef332511e3caf17fb5943c404c55df5fd.zip
Make various max packet sizes unsigned, and clean up from that.
Make some packet size variables unsigned. Leave some others signed, because they're read with sscanf(), and sscanf() handles string-to-unsigned conversions in the same crazy way strtouX() routines do, wherein a leading sign is *not* an error. Instead, cast them to unsigned after we make sure they're not negative.
Diffstat (limited to 'wiretap/cosine.c')
-rw-r--r--wiretap/cosine.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/wiretap/cosine.c b/wiretap/cosine.c
index 3248656f1a..f665816c14 100644
--- a/wiretap/cosine.c
+++ b/wiretap/cosine.c
@@ -367,14 +367,14 @@ parse_cosine_packet(FILE_T fh, wtap_rec *rec, Buffer *buf,
*err_info = g_strdup("cosine: packet header has a negative packet length");
return FALSE;
}
- if (pkt_len > WTAP_MAX_PACKET_SIZE_STANDARD) {
+ if ((guint)pkt_len > WTAP_MAX_PACKET_SIZE_STANDARD) {
/*
* Probably a corrupt capture file; don't blow up trying
* to allocate space for an immensely-large packet.
*/
*err = WTAP_ERR_BAD_FILE;
*err_info = g_strdup_printf("cosine: File has %u-byte packet, bigger than maximum of %u",
- pkt_len, WTAP_MAX_PACKET_SIZE_STANDARD);
+ (guint)pkt_len, WTAP_MAX_PACKET_SIZE_STANDARD);
return FALSE;
}