INN commit: trunk (lib/getnameinfo.c tests/lib/getnameinfo-t.c)

INN Commit Russ_Allbery at isc.org
Thu Jan 29 20:24:56 UTC 2009


    Date: Thursday, January 29, 2009 @ 12:24:56
  Author: iulius
Revision: 8303

Add a few casts to silent gcc warnings during the build.

Modified:
  trunk/lib/getnameinfo.c
  trunk/tests/lib/getnameinfo-t.c

---------------------------+
 lib/getnameinfo.c         |    8 ++++----
 tests/lib/getnameinfo-t.c |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

Modified: lib/getnameinfo.c
===================================================================
--- lib/getnameinfo.c	2009-01-29 19:46:28 UTC (rev 8302)
+++ lib/getnameinfo.c	2009-01-29 20:24:56 UTC (rev 8303)
@@ -48,7 +48,7 @@
 {
     if (strchr(name, '.') == NULL)
         return false;
-    if (strlen(name) > nodelen - 1)
+    if (strlen(name) > (unsigned) nodelen - 1)
         *status = EAI_OVERFLOW;
     else {
         strlcpy(node, name, nodelen);
@@ -73,7 +73,7 @@
 
     /* Do the name lookup first unless told not to. */
     if (!(flags & NI_NUMERICHOST)) {
-        host = gethostbyaddr(addr, sizeof(struct in_addr), AF_INET);
+        host = gethostbyaddr((char *) addr, sizeof(struct in_addr), AF_INET);
         if (host == NULL) {
             if (flags & NI_NAMEREQD)
                 return EAI_NONAME;
@@ -93,7 +93,7 @@
 
     /* Just convert the address to ASCII. */
     name = inet_ntoa(*addr);
-    if (strlen(name) > nodelen - 1)
+    if (strlen(name) > (unsigned) nodelen - 1)
         return EAI_OVERFLOW;
     strlcpy(node, name, nodelen);
     return 0;
@@ -116,7 +116,7 @@
         protocol = (flags & NI_DGRAM) ? "udp" : "tcp";
         srv = getservbyport(htons(port), protocol);
         if (srv != NULL) {
-            if (strlen(srv->s_name) > servicelen - 1)
+            if (strlen(srv->s_name) > (unsigned) servicelen - 1)
                 return EAI_OVERFLOW;
             strlcpy(service, srv->s_name, servicelen);
             return 0;

Modified: tests/lib/getnameinfo-t.c
===================================================================
--- tests/lib/getnameinfo-t.c	2009-01-29 19:46:28 UTC (rev 8302)
+++ tests/lib/getnameinfo-t.c	2009-01-29 20:24:56 UTC (rev 8303)
@@ -88,7 +88,7 @@
         skip_block(21, 2, "cannot look up www.isc.org");
     else {
         memcpy(&sin.sin_addr, hp->h_addr, sizeof(sin.sin_addr));
-        hp = gethostbyaddr(&sin.sin_addr, sizeof(sin.sin_addr), AF_INET);
+        hp = gethostbyaddr((char *) &sin.sin_addr, sizeof(sin.sin_addr), AF_INET);
         if (hp == NULL || strchr(hp->h_name, '.') == NULL)
             skip_block(21, 2, "cannot reverse-lookup www.isc.org");
         else {




More information about the inn-committers mailing list