summaryrefslogtreecommitdiff
path: root/tools/hcidump.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-08-30 11:37:51 -0700
committerMarcel Holtmann <marcel@holtmann.org>2012-12-17 23:52:59 +0100
commit4c031b07da8fd971117cf739ba71a89ea7e84150 (patch)
tree1267cc8988c74c41b8ccbd4e53de2c0140140310 /tools/hcidump.c
parent9ae42c451f0da80820909b1fdaaa03abcae6b02e (diff)
downloadbluez-4c031b07da8fd971117cf739ba71a89ea7e84150.tar.gz
hcidump: Fix unsigned versus signed integer comparison
Diffstat (limited to 'tools/hcidump.c')
-rw-r--r--tools/hcidump.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/hcidump.c b/tools/hcidump.c
index a14a78461..8e5f663a4 100644
--- a/tools/hcidump.c
+++ b/tools/hcidump.c
@@ -743,7 +743,8 @@ static int wait_connection(char *addr, char *port)
struct addrinfo *ai, *runp;
struct addrinfo hints;
struct pollfd fds[3];
- int err, opt, datagram, nfds = 0;
+ unsigned int nfds = 0;
+ int err, opt, datagram;
memset(&hints, 0, sizeof (hints));
hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
@@ -815,7 +816,8 @@ static int wait_connection(char *addr, char *port)
freeaddrinfo(ai);
while (1) {
- int i, n = poll(fds, nfds, -1);
+ unsigned int i;
+ int n = poll(fds, nfds, -1);
if (n <= 0)
continue;
@@ -844,7 +846,7 @@ static int wait_connection(char *addr, char *port)
printf("client: %s:%s snap_len: %d filter: 0x%lx\n",
hname, hport, snap_len, parser.filter);
- for (n = 0; n < nfds; n++)
+ for (n = 0; n < (int) nfds; n++)
close(fds[n].fd);
return sk;