aboutsummaryrefslogtreecommitdiffstats
path: root/rawshark.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-04-15 12:37:34 -0700
committerGuy Harris <guy@alum.mit.edu>2017-04-15 19:38:10 +0000
commit237d23dc7355f066d772ba6ad184d5f99c25fa5a (patch)
tree899c4ec34d6f4aa6b0c64e7428af7e34640493f6 /rawshark.c
parent3743186bcf5cd37b56f40069341565b4e6ad196c (diff)
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 <guy@alum.mit.edu>
Diffstat (limited to 'rawshark.c')
-rw-r--r--rawshark.c6
1 files 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;
}