From 3e28110af3e2bd624b3f247ed85b6912604d8e23 Mon Sep 17 00:00:00 2001
From: Sascha Wildner <saw@online.de>
Date: Mon, 27 Dec 2021 18:19:55 +0100
Subject: [PATCH 3/5] miscellaneous changes, grep for 0x in nolit.txt and for
 'x' in the code.

---
 lib/libc/inet/inet_addr.c     | 1 +
 lib/libc/inet/inet_net_pton.c | 1 +
 lib/libc/inet/inet_network.c  | 1 +
 lib/libc/inet/nsap_addr.c     | 1 +
 lib/libc/locale/isctype.c     | 2 ++
 lib/libutil/login.conf.5      | 1 +
 libexec/bootpd/bootptab.5     | 1 +
 sys/libprop/prop_number.c     | 1 +
 8 files changed, 9 insertions(+)

diff --git a/lib/libc/inet/inet_addr.c b/lib/libc/inet/inet_addr.c
index 854e1bd7bd5..3edc4623f45 100644
--- a/lib/libc/inet/inet_addr.c
+++ b/lib/libc/inet/inet_addr.c
@@ -120,6 +120,7 @@ inet_aton(const char *cp, struct in_addr *addr) {
 		val = 0; base = 10; digit = 0;
 		if (c == '0') {
 			c = *++cp;
+			/* XXX does this need adjustment for 0b and 0B? */
 			if (c == 'x' || c == 'X')
 				base = 16, c = *++cp;
 			else {
diff --git a/lib/libc/inet/inet_net_pton.c b/lib/libc/inet/inet_net_pton.c
index 7d7a1a42dfc..99ce18f563e 100644
--- a/lib/libc/inet/inet_net_pton.c
+++ b/lib/libc/inet/inet_net_pton.c
@@ -58,6 +58,7 @@ inet_net_pton_ipv4(const char *src, u_char *dst, size_t size) {
 	const u_char *odst = dst;
 
 	ch = *src++;
+	/* XXX does this need adjustment for 0b and 0B? */
 	if (ch == '0' && (src[0] == 'x' || src[0] == 'X')
 	    && isascii((unsigned char)(src[1]))
 	    && isxdigit((unsigned char)(src[1]))) {
diff --git a/lib/libc/inet/inet_network.c b/lib/libc/inet/inet_network.c
index f461f22d3de..15c59e9d512 100644
--- a/lib/libc/inet/inet_network.c
+++ b/lib/libc/inet/inet_network.c
@@ -56,6 +56,7 @@ inet_network(const char *cp)
 	val = 0; base = 10; digit = 0;
 	if (*cp == '0')
 		digit = 1, base = 8, cp++;
+	/* XXX does this need adjustment for 0b and 0B? */
 	if (*cp == 'x' || *cp == 'X')
 		base = 16, cp++;
 	while ((c = *cp) != 0) {
diff --git a/lib/libc/inet/nsap_addr.c b/lib/libc/inet/nsap_addr.c
index 6ca7891a33b..edfd895c667 100644
--- a/lib/libc/inet/nsap_addr.c
+++ b/lib/libc/inet/nsap_addr.c
@@ -43,6 +43,7 @@ inet_nsap_addr(const char *ascii, u_char *binary, int maxlen) {
 	u_char c, nib;
 	u_int len = 0;
 
+	/* XXX does this need adjustment for 0b and 0B? */
 	if (ascii[0] != '0' || (ascii[1] != 'x' && ascii[1] != 'X'))
 		return (0);
 	ascii += 2;
diff --git a/lib/libc/locale/isctype.c b/lib/libc/locale/isctype.c
index 5bd35bc0eb7..416a40a81c2 100644
--- a/lib/libc/locale/isctype.c
+++ b/lib/libc/locale/isctype.c
@@ -181,6 +181,8 @@ isxdigit(int c)
 	return (__isctype(c, _CTYPE_X));
 }
 
+/* XXX do we need isbdigit() here? */
+
 #undef toascii
 int
 toascii(int c)
diff --git a/lib/libutil/login.conf.5 b/lib/libutil/login.conf.5
index da9bfcf7fb2..6b6e0587e83 100644
--- a/lib/libutil/login.conf.5
+++ b/lib/libutil/login.conf.5
@@ -122,6 +122,7 @@ A space or comma separated list of path names, following the usual csh
 conventions (leading tilde with and without username being expanded to
 home directories etc.)
 .It number
+.\" XXX does this need adjustment for 0b and 0B?
 A numeric value, either decimal (default), hexadecimal (with leading 0x),
 or octal (with a leading 0).
 With a numeric type, only one numeric value is allowed.
diff --git a/libexec/bootpd/bootptab.5 b/libexec/bootpd/bootptab.5
index ac975a1f598..506696e9f6c 100644
--- a/libexec/bootpd/bootptab.5
+++ b/libexec/bootpd/bootptab.5
@@ -137,6 +137,7 @@ The
 and
 .Em ys
 tags each take a single IP address.
+.\"XXX does this need adjustment for 0b and 0B?
 All IP addresses are specified in standard Internet "dot" notation
 and may use decimal, octal, or hexadecimal numbers
 (octal numbers begin with 0, hexadecimal numbers begin with '0x' or '0X').
diff --git a/sys/libprop/prop_number.c b/sys/libprop/prop_number.c
index cbd84b816a7..2730264e790 100644
--- a/sys/libprop/prop_number.c
+++ b/sys/libprop/prop_number.c
@@ -577,6 +577,7 @@ _prop_number_internalize(prop_stack_t stack, prop_object_t *obj,
 	if (ctx->poic_cp[0] == '-') {
 		if (_prop_number_internalize_signed(ctx, &pnv) == false)
 			return (true);
+	/* XXX does this need adjustment for 0b and 0B? */
 	} else if (ctx->poic_cp[0] == '0' && ctx->poic_cp[1] == 'x') {
 		if (_prop_number_internalize_unsigned(ctx, &pnv) == false)
 			return (true);
-- 
2.42.0

