[BACK]Return to inet_pton.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_pton.c between version 1.7 and 1.8

version 1.7, 2009/04/12 17:07:17 version 1.8, 2012/03/13 21:13:38
Line 35  __RCSID("$NetBSD$");
Line 35  __RCSID("$NetBSD$");
 #include <netinet/in.h>  #include <netinet/in.h>
 #include <arpa/inet.h>  #include <arpa/inet.h>
 #include <arpa/nameser.h>  #include <arpa/nameser.h>
   #include <stddef.h>
 #include <string.h>  #include <string.h>
 #include <assert.h>  #include <assert.h>
 #include <ctype.h>  #include <ctype.h>
Line 100  inet_pton4(const char *src, u_char *dst,
Line 101  inet_pton4(const char *src, u_char *dst,
 {  {
         u_int32_t val;          u_int32_t val;
         u_int digit, base;          u_int digit, base;
         int n;          ptrdiff_t n;
         unsigned char c;          unsigned char c;
         u_int parts[4];          u_int parts[4];
         register u_int *pp = parts;          u_int *pp = parts;
   
         _DIAGASSERT(src != NULL);          _DIAGASSERT(src != NULL);
         _DIAGASSERT(dst != NULL);          _DIAGASSERT(dst != NULL);
Line 248  inet_pton6(const char *src, u_char *dst)
Line 249  inet_pton6(const char *src, u_char *dst)
                         pch = strchr((xdigits = xdigits_u), ch);                          pch = strchr((xdigits = xdigits_u), ch);
                 if (pch != NULL) {                  if (pch != NULL) {
                         val <<= 4;                          val <<= 4;
                         val |= (pch - xdigits);                          val |= (int)(pch - xdigits);
                         if (++seen_xdigits > 4)                          if (++seen_xdigits > 4)
                                 return (0);                                  return (0);
                         continue;                          continue;
Line 289  inet_pton6(const char *src, u_char *dst)
Line 290  inet_pton6(const char *src, u_char *dst)
                  * Since some memmove()'s erroneously fail to handle                   * Since some memmove()'s erroneously fail to handle
                  * overlapping regions, we'll do the shift by hand.                   * overlapping regions, we'll do the shift by hand.
                  */                   */
                 const int n = tp - colonp;                  const ptrdiff_t n = tp - colonp;
                 int i;                  int i;
   
                 if (tp == endp)                  if (tp == endp)

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

CVSweb <webmaster@jp.NetBSD.org>