diff options
author | Mike Barcroft <mike@FreeBSD.org> | 2002-09-25 04:06:37 +0000 |
---|---|---|
committer | Mike Barcroft <mike@FreeBSD.org> | 2002-09-25 04:06:37 +0000 |
commit | 89fdc4e117285d001665922c93080c804a8f8810 (patch) | |
tree | 2295edf76df9065e84ea0b415c9c13ecf434f1fa /lib | |
parent | df93d794dccd272ca6d809e325cd381faeb6a4df (diff) |
Use the standardized CHAR_BIT constant instead of NBBY in userland.
Notes
Notes:
svn path=/head/; revision=103949
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/net/res_init.c | 5 | ||||
-rw-r--r-- | lib/libstand/printf.c | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/libc/net/res_init.c b/lib/libc/net/res_init.c index e855ccbf5fda..9bb845269c18 100644 --- a/lib/libc/net/res_init.c +++ b/lib/libc/net/res_init.c @@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$"); #include <arpa/inet.h> #include <arpa/nameser.h> #include <ctype.h> +#include <limits.h> #include <resolv.h> #include <stdio.h> #include <stdlib.h> @@ -414,7 +415,7 @@ res_init() } /*FALLTHROUGH*/ default: - m = sizeof(struct in6_addr) * NBBY; + m = sizeof(struct in6_addr) * CHAR_BIT; break; } if (m >= 0) { @@ -422,7 +423,7 @@ res_init() if (m <= 0) { *u = 0; } else { - m -= NBBY; + m -= CHAR_BIT; *u = (u_char)~0; if (m < 0) *u <<= -m; diff --git a/lib/libstand/printf.c b/lib/libstand/printf.c index 6afcbfd37916..5f1bedc03d7c 100644 --- a/lib/libstand/printf.c +++ b/lib/libstand/printf.c @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); */ #include <sys/types.h> +#include <limits.h> #include <string.h> #include "stand.h" @@ -109,7 +110,7 @@ ksprintn(ul, base, lenp) u_long ul; int base, *lenp; { /* A long in base 8, plus NULL. */ - static char buf[sizeof(long) * NBBY / 3 + 2]; + static char buf[sizeof(long) * CHAR_BIT / 3 + 2]; char *p; p = buf; |