summaryrefslogtreecommitdiff
path: root/tcpdump.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2019-07-21 15:20:54 +0200
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2019-07-21 15:20:54 +0200
commitaf610a77a955a88b3fb3bdef1f08c4858893ff68 (patch)
tree73b376d4273bd4a0fa56de22b3b11327cee44184 /tcpdump.c
parent81a8988eee9f1faea5974f37878a97bd5e80b2b8 (diff)
downloadtcpdump-af610a77a955a88b3fb3bdef1f08c4858893ff68.tar.gz
Fix a warning
The warning was: ./tcpdump.c:1059:7: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32] cc = read(fd, cp, (u_int)buf.st_size); ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Diffstat (limited to 'tcpdump.c')
-rw-r--r--tcpdump.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tcpdump.c b/tcpdump.c
index 52af74af..53164a7f 100644
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -1041,7 +1041,8 @@ copy_argv(char **argv)
static char *
read_infile(char *fname)
{
- int i, fd, cc;
+ int i, fd;
+ ssize_t cc;
char *cp;
struct stat buf;
@@ -1060,7 +1061,7 @@ read_infile(char *fname)
if (cc < 0)
error("read %s: %s", fname, pcap_strerror(errno));
if (cc != buf.st_size)
- error("short read %s (%d != %d)", fname, cc, (int)buf.st_size);
+ error("short read %s (%zd != %d)", fname, cc, (int)buf.st_size);
close(fd);
/* replace "# comment" with spaces */