summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormike <mike@FreeBSD.org>2002-09-25 04:06:37 +0000
committermike <mike@FreeBSD.org>2002-09-25 04:06:37 +0000
commit86a758e51be945d9e690ee0802a21bf9a667b4e8 (patch)
tree2295edf76df9065e84ea0b415c9c13ecf434f1fa /lib
parentb9155304da025f935d34f191093267f40e40cdd2 (diff)
downloadFreeBSD-src-86a758e51be945d9e690ee0802a21bf9a667b4e8.zip
FreeBSD-src-86a758e51be945d9e690ee0802a21bf9a667b4e8.tar.gz
Use the standardized CHAR_BIT constant instead of NBBY in userland.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/net/res_init.c5
-rw-r--r--lib/libstand/printf.c3
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/libc/net/res_init.c b/lib/libc/net/res_init.c
index e855ccb..9bb8452 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 6afcbfd..5f1bedc 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;
OpenPOWER on IntegriCloud