[BACK]Return to nsap_addr.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/nsap_addr.c between version 1.1 and 1.2

version 1.1, 2004/05/20 22:29:02 version 1.2, 2004/05/20 23:12:33
Line 17 
Line 17 
  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.   * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */   */
   
   #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)  #if defined(LIBC_SCCS) && !defined(lint)
   #if 0
 static const char rcsid[] = "Id: nsap_addr.c,v 1.2.206.1 2004/03/09 08:33:33 marka Exp";  static const char rcsid[] = "Id: nsap_addr.c,v 1.2.206.1 2004/03/09 08:33:33 marka Exp";
   #else
   __RCSID("$NetBSD$");
   #endif
 #endif /* LIBC_SCCS and not lint */  #endif /* LIBC_SCCS and not lint */
   
 #include "port_before.h"  #include "port_before.h"
   
   #include "namespace.h"
 #include <sys/types.h>  #include <sys/types.h>
 #include <sys/param.h>  #include <sys/param.h>
 #include <sys/socket.h>  #include <sys/socket.h>
Line 31  static const char rcsid[] = "Id: nsap_ad
Line 37  static const char rcsid[] = "Id: nsap_ad
 #include <arpa/inet.h>  #include <arpa/inet.h>
 #include <arpa/nameser.h>  #include <arpa/nameser.h>
   
   #include <assert.h>
 #include <ctype.h>  #include <ctype.h>
 #include <resolv.h>  #include <resolv.h>
   
 #include "port_after.h"  #include "port_after.h"
   
   #ifdef __weak_alias
   __weak_alias(inet_nsap_addr,_inet_nsap_addr)
   __weak_alias(inet_nsap_ntoa,_inet_nsap_ntoa)
   #endif
   
 static char  static char
 xtob(int c) {  xtob(int c) {
         return (c - (((c >= '0') && (c <= '9')) ? '0' : '7'));          return (c - (((c >= '0') && (c <= '9')) ? '0' : '7'));
Line 46  inet_nsap_addr(const char *ascii, u_char
Line 58  inet_nsap_addr(const char *ascii, u_char
         u_char c, nib;          u_char c, nib;
         u_int len = 0;          u_int len = 0;
   
           _DIAGASSERT(ascii != NULL);
           _DIAGASSERT(binary != NULL);
   
         if (ascii[0] != '0' || (ascii[1] != 'x' && ascii[1] != 'X'))          if (ascii[0] != '0' || (ascii[1] != 'x' && ascii[1] != 'X'))
                 return (0);                  return (0);
         ascii += 2;          ascii += 2;
Line 84  inet_nsap_ntoa(int binlen, const u_char 
Line 99  inet_nsap_ntoa(int binlen, const u_char 
         static char tmpbuf[2+255*3];          static char tmpbuf[2+255*3];
         char *start;          char *start;
   
           _DIAGASSERT(binary != NULL);
   
         if (ascii)          if (ascii)
                 start = ascii;                  start = ascii;
         else {          else {
Line 98  inet_nsap_ntoa(int binlen, const u_char 
Line 115  inet_nsap_ntoa(int binlen, const u_char 
                 binlen = 255;                  binlen = 255;
   
         for (i = 0; i < binlen; i++) {          for (i = 0; i < binlen; i++) {
                 nib = *binary >> 4;                  nib = (u_int32_t)*binary >> 4;
                 *ascii++ = nib + (nib < 10 ? '0' : '7');                  *ascii++ = nib + (nib < 10 ? '0' : '7');
                 nib = *binary++ & 0x0f;                  nib = *binary++ & 0x0f;
                 *ascii++ = nib + (nib < 10 ? '0' : '7');                  *ascii++ = nib + (nib < 10 ? '0' : '7');

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

CVSweb <webmaster@jp.NetBSD.org>