From 237d23dc7355f066d772ba6ad184d5f99c25fa5a Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sat, 15 Apr 2017 12:37:34 -0700 Subject: [PATCH] Squelch some compiler warnings. Cast an ssize_t value to unsigned int before subtracting it from an unsigned int. The value is already known to be >= 0 and <= the value from which we're subtracting it, and that latter value is an unsigned int, so it's guaranteed to fit into an unsigned int. (ssize_t can be bigger than unsigned int.) Change-Id: I5c4d3c7fa4bf241c9ea72661beca89bc30495a3b Reviewed-on: https://code.wireshark.org/review/21114 Reviewed-by: Guy Harris --- rawshark.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rawshark.c b/rawshark.c index a710be1dee..0476223095 100644 --- a/rawshark.c +++ b/rawshark.c @@ -823,7 +823,7 @@ main(int argc, char *argv[]) ret = FORMAT_ERROR; goto clean_exit; } - bytes_left -= bytes; + bytes_left -= (unsigned int)bytes; } } @@ -904,7 +904,7 @@ raw_pipe_read(struct wtap_pkthdr *phdr, guchar * pd, int *err, gchar **err_info, *err_info = NULL; return FALSE; } - bytes_needed -= bytes_read; + bytes_needed -= (unsigned int)bytes_read; *data_offset += bytes_read; ptr += bytes_read; } @@ -950,7 +950,7 @@ raw_pipe_read(struct wtap_pkthdr *phdr, guchar * pd, int *err, gchar **err_info, *err_info = NULL; return FALSE; } - bytes_needed -= bytes_read; + bytes_needed -= (unsigned int)bytes_read; *data_offset += bytes_read; ptr += bytes_read; }