[BACK]Return to inet_ntop.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libc / inet

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/lib/libc/inet/inet_ntop.c between version 1.10 and 1.11

version 1.10, 2014/02/10 16:29:30 version 1.11, 2014/02/10 16:30:54
Line 74  inet_ntop(int af, const void *src, char 
Line 74  inet_ntop(int af, const void *src, char 
   
         switch (af) {          switch (af) {
         case AF_INET:          case AF_INET:
                 return (inet_ntop4(src, dst, size));                  return inet_ntop4(src, dst, size);
         case AF_INET6:          case AF_INET6:
                 return (inet_ntop6(src, dst, size));                  return inet_ntop6(src, dst, size);
         default:          default:
                 errno = EAFNOSUPPORT;                  errno = EAFNOSUPPORT;
                 return (NULL);                  return NULL;
         }          }
         /* NOTREACHED */          /* NOTREACHED */
 }  }
Line 106  inet_ntop4(const u_char *src, char *dst,
Line 106  inet_ntop4(const u_char *src, char *dst,
   
         l = snprintf(tmp, sizeof(tmp), "%u.%u.%u.%u",          l = snprintf(tmp, sizeof(tmp), "%u.%u.%u.%u",
             src[0], src[1], src[2], src[3]);              src[0], src[1], src[2], src[3]);
         if (l <= 0 || (socklen_t) l >= size) {          if (l <= 0 || (socklen_t) l >= size)
                 errno = ENOSPC;                  return NULL;
                 return (NULL);  
         }  
         strlcpy(dst, tmp, size);          strlcpy(dst, tmp, size);
         return (dst);          return dst;
 }  }
   
 /* const char *  /* const char *
Line 224  inet_ntop6(const u_char *src, char *dst,
Line 222  inet_ntop6(const u_char *src, char *dst,
         if ((size_t)(tp - tmp) > size)          if ((size_t)(tp - tmp) > size)
                 goto out;                  goto out;
         strlcpy(dst, tmp, size);          strlcpy(dst, tmp, size);
         return (dst);          return dst;
 out:  out:
         errno = ENOSPC;          errno = ENOSPC;
         return NULL;          return NULL;

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

CVSweb <webmaster@jp.NetBSD.org>