summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/nsap_addr.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1998-06-11 09:03:02 +0000
committerpeter <peter@FreeBSD.org>1998-06-11 09:03:02 +0000
commit9492d9f3a276bb1ce288f7f1242f55ba381fb5d8 (patch)
tree1fedca6b8adcc385c524308ec3d4040f66de30c6 /lib/libc/net/nsap_addr.c
parenta17a83618dae26baf5445f202b4ed0ce247b3f86 (diff)
downloadFreeBSD-src-9492d9f3a276bb1ce288f7f1242f55ba381fb5d8.zip
FreeBSD-src-9492d9f3a276bb1ce288f7f1242f55ba381fb5d8.tar.gz
Update the resolver parts to bind-8.1.2 level. I have not touched the
getXXXXbyYYYY() interfaces yet. Obtained from: diff relative to bind-8.1.2 sources
Diffstat (limited to 'lib/libc/net/nsap_addr.c')
-rw-r--r--lib/libc/net/nsap_addr.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/libc/net/nsap_addr.c b/lib/libc/net/nsap_addr.c
index b0c6433..1db7dd7 100644
--- a/lib/libc/net/nsap_addr.c
+++ b/lib/libc/net/nsap_addr.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996 by Internet Software Consortium.
+ * Copyright (c) 1996, 1998 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -16,13 +16,14 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id$";
+static char rcsid[] = "$Id: nsap_addr.c,v 1.4 1997/02/22 15:00:27 peter Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
+#include <arpa/inet.h>
#include <arpa/nameser.h>
#include <ctype.h>
#include <resolv.h>
@@ -40,10 +41,10 @@ inet_nsap_addr(ascii, binary, maxlen)
u_char *binary;
int maxlen;
{
- register u_char c, nib;
+ u_char c, nib;
u_int len = 0;
- while ((c = *ascii++) != '\0' && len < maxlen) {
+ while ((c = *ascii++) != '\0' && len < (u_int)maxlen) {
if (c == '.' || c == '+' || c == '/')
continue;
if (!isascii(c))
@@ -52,7 +53,8 @@ inet_nsap_addr(ascii, binary, maxlen)
c = toupper(c);
if (isxdigit(c)) {
nib = xtob(c);
- if ((c = *ascii++) != '\0') {
+ c = *ascii++;
+ if (c != '\0') {
c = toupper(c);
if (isxdigit(c)) {
*binary++ = (nib << 4) | xtob(c);
OpenPOWER on IntegriCloud