summaryrefslogtreecommitdiffstats
path: root/lib/libc/inet/inet_cidr_pton.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/inet/inet_cidr_pton.c')
-rw-r--r--lib/libc/inet/inet_cidr_pton.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/libc/inet/inet_cidr_pton.c b/lib/libc/inet/inet_cidr_pton.c
index b55e3ea..3089eb9 100644
--- a/lib/libc/inet/inet_cidr_pton.c
+++ b/lib/libc/inet/inet_cidr_pton.c
@@ -16,8 +16,10 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$Id: inet_cidr_pton.c,v 1.5.18.1 2005/04/27 05:00:53 sra Exp $";
+static const char rcsid[] = "$Id: inet_cidr_pton.c,v 1.2.2.1.8.2 2004/03/17 00:29:46 marka Exp $";
#endif
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
#include "port_before.h"
@@ -27,7 +29,7 @@ static const char rcsid[] = "$Id: inet_cidr_pton.c,v 1.5.18.1 2005/04/27 05:00:5
#include <arpa/nameser.h>
#include <arpa/inet.h>
-#include <isc/assertions.h>
+#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
@@ -49,7 +51,7 @@ static int inet_cidr_pton_ipv6 __P((const char *src, u_char *dst,
static int getbits(const char *, int ipv6);
-/*%
+/*
* int
* inet_cidr_pton(af, src, dst, *bits)
* convert network address from presentation to network format.
@@ -92,7 +94,7 @@ inet_cidr_pton_ipv4(const char *src, u_char *dst, int *pbits, int ipv6) {
tmp = 0;
do {
n = strchr(digits, ch) - digits;
- INSIST(n >= 0 && n <= 9);
+ assert(n >= 0 && n <= 9);
tmp *= 10;
tmp += n;
if (tmp > 255)
@@ -204,7 +206,7 @@ inet_cidr_pton_ipv6(const char *src, u_char *dst, int *pbits) {
inet_cidr_pton_ipv4(curtok, tp, &bits, 1) == 0) {
tp += NS_INADDRSZ;
saw_xdigit = 0;
- break; /*%< '\\0' was seen by inet_pton4(). */
+ break; /* '\0' was seen by inet_pton4(). */
}
if (ch == '/') {
bits = getbits(src, 1);
@@ -256,22 +258,20 @@ getbits(const char *src, int ipv6) {
int bits = 0;
char *cp, ch;
- if (*src == '\0') /*%< syntax */
+ if (*src == '\0') /* syntax */
return (-2);
do {
ch = *src++;
cp = strchr(digits, ch);
- if (cp == NULL) /*%< syntax */
+ if (cp == NULL) /* syntax */
return (-2);
bits *= 10;
bits += cp - digits;
- if (bits == 0 && *src != '\0') /*%< no leading zeros */
+ if (bits == 0 && *src != '\0') /* no leading zeros */
return (-2);
- if (bits > (ipv6 ? 128 : 32)) /*%< range error */
+ if (bits > (ipv6 ? 128 : 32)) /* range error */
return (-2);
} while (*src != '\0');
return (bits);
}
-
-/*! \file */
OpenPOWER on IntegriCloud