diff options
author | Guy Harris <guy@alum.mit.edu> | 2011-03-27 17:26:21 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2011-03-27 17:26:21 +0000 |
commit | 5749270c56cac51a8c19af8125b4a0ac6f534ee1 (patch) | |
tree | 5a42fe6a04532c372419e6f5ca860aadb26e5974 /tap-hosts.c | |
parent | 0da2042447073d08a09ec371c899660cfe5a5466 (diff) |
If there are more than 4 billion characters in the printable form of a
network address, we have bigger problems. Cast the result of strlen()
to int to squelch a compiler warning with MSVC++.
svn path=/trunk/; revision=36375
Diffstat (limited to 'tap-hosts.c')
-rw-r--r-- | tap-hosts.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tap-hosts.c b/tap-hosts.c index 592a081b37..ff3d81251d 100644 --- a/tap-hosts.c +++ b/tap-hosts.c @@ -107,7 +107,7 @@ hosts_draw(void *dummy _U_) sa4 = (struct sockaddr_in *) ai->ai_addr; if (inet_ntop(AF_INET, &(sa4->sin_addr.s_addr), addr_str, ADDRSTRLEN)) { - tab_count = (HOSTNAME_POS - strlen(addr_str)) / 8; + tab_count = (HOSTNAME_POS - (int)strlen(addr_str)) / 8; printf("%s", addr_str); for (i = 0; i < tab_count; i++) printf("\t"); @@ -123,7 +123,7 @@ hosts_draw(void *dummy _U_) sa6 = (struct sockaddr_in6 *) ai->ai_addr; if (inet_ntop(AF_INET6, sa6->sin6_addr.s6_addr, addr_str, ADDRSTRLEN)) { - tab_count = (HOSTNAME_POS - strlen(addr_str)) / 8; + tab_count = (HOSTNAME_POS - (int)strlen(addr_str)) / 8; printf("%s", addr_str); for (i = 0; i < tab_count; i++) printf("\t"); |