summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/crypt/arc4random.c5
-rw-r--r--src/lib/libc/crypt/bcrypt.c4
-rw-r--r--src/lib/libc/crypt/crypt.c4
-rw-r--r--src/lib/libc/net/base64.c6
-rw-r--r--src/lib/libc/net/gethostnamadr.c10
-rw-r--r--src/lib/libc/net/getnetbyaddr.c4
-rw-r--r--src/lib/libc/net/getnetbyname.c4
-rw-r--r--src/lib/libc/net/getproto.c4
-rw-r--r--src/lib/libc/net/getprotoname.c4
-rw-r--r--src/lib/libc/net/getservbyname.c4
-rw-r--r--src/lib/libc/net/getservbyport.c4
-rw-r--r--src/lib/libc/net/inet_network.c4
-rw-r--r--src/lib/libc/net/ipx_addr.c4
-rw-r--r--src/lib/libc/net/ns_addr.c4
-rw-r--r--src/lib/libc/net/ns_ntoa.c4
-rw-r--r--src/lib/libc/net/nsap_addr.c6
-rw-r--r--src/lib/libc/net/rcmd.c3
-rw-r--r--src/lib/libc/net/res_comp.c8
-rw-r--r--src/lib/libc/net/res_debug.c20
-rw-r--r--src/lib/libc/net/res_query.c5
20 files changed, 58 insertions, 53 deletions
diff --git a/src/lib/libc/crypt/arc4random.c b/src/lib/libc/crypt/arc4random.c
index 078f4eeea6..d34de2be7d 100644
--- a/src/lib/libc/crypt/arc4random.c
+++ b/src/lib/libc/crypt/arc4random.c
@@ -1,4 +1,4 @@
1/* $Id: arc4random.c,v 1.1 1996/12/28 06:33:01 dm Exp $ */ 1/* $Id: arc4random.c,v 1.2 1997/07/09 01:08:16 millert Exp $ */
2 2
3/* 3/*
4 * Arc4 random number generator for OpenBSD. 4 * Arc4 random number generator for OpenBSD.
@@ -25,8 +25,9 @@
25 * RC4 is a registered trademark of RSA Laboratories. 25 * RC4 is a registered trademark of RSA Laboratories.
26 */ 26 */
27 27
28#include <stdlib.h>
29#include <fcntl.h> 28#include <fcntl.h>
29#include <stdlib.h>
30#include <unistd.h>
30#include <sys/types.h> 31#include <sys/types.h>
31#include <sys/time.h> 32#include <sys/time.h>
32 33
diff --git a/src/lib/libc/crypt/bcrypt.c b/src/lib/libc/crypt/bcrypt.c
index 0a0cca14a1..6f78afdddf 100644
--- a/src/lib/libc/crypt/bcrypt.c
+++ b/src/lib/libc/crypt/bcrypt.c
@@ -1,4 +1,5 @@
1/* $OpenBSD: bcrypt.c,v 1.6 1997/07/01 20:12:43 provos Exp $ */ 1/* $OpenBSD: bcrypt.c,v 1.7 1997/07/09 01:08:18 millert Exp $ */
2
2/* 3/*
3 * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de> 4 * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de>
4 * All rights reserved. 5 * All rights reserved.
@@ -48,6 +49,7 @@
48#include <stdio.h> 49#include <stdio.h>
49#endif 50#endif
50 51
52#include <stdio.h>
51#include <stdlib.h> 53#include <stdlib.h>
52#include <sys/types.h> 54#include <sys/types.h>
53#include <string.h> 55#include <string.h>
diff --git a/src/lib/libc/crypt/crypt.c b/src/lib/libc/crypt/crypt.c
index caa58df486..a3a1338023 100644
--- a/src/lib/libc/crypt/crypt.c
+++ b/src/lib/libc/crypt/crypt.c
@@ -50,7 +50,7 @@
50 */ 50 */
51 51
52#if defined(LIBC_SCCS) && !defined(lint) 52#if defined(LIBC_SCCS) && !defined(lint)
53static char rcsid[] = "$OpenBSD: crypt.c,v 1.10 1997/03/30 20:24:46 deraadt Exp $"; 53static char rcsid[] = "$OpenBSD: crypt.c,v 1.11 1997/07/09 01:08:14 millert Exp $";
54#endif /* LIBC_SCCS and not lint */ 54#endif /* LIBC_SCCS and not lint */
55 55
56#include <sys/types.h> 56#include <sys/types.h>
@@ -612,7 +612,7 @@ crypt(key, setting)
612 */ 612 */
613 q = (u_char *) keybuf; 613 q = (u_char *) keybuf;
614 while ((q - (u_char *) keybuf) < sizeof(keybuf)) { 614 while ((q - (u_char *) keybuf) < sizeof(keybuf)) {
615 if (*q++ = *key << 1) 615 if ((*q++ = *key << 1))
616 key++; 616 key++;
617 } 617 }
618 if (des_setkey((u_char *) keybuf)) 618 if (des_setkey((u_char *) keybuf))
diff --git a/src/lib/libc/net/base64.c b/src/lib/libc/net/base64.c
index 59788bee1b..a2055f5cc3 100644
--- a/src/lib/libc/net/base64.c
+++ b/src/lib/libc/net/base64.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: base64.c,v 1.1 1997/03/13 19:07:22 downsj Exp $ */ 1/* $OpenBSD: base64.c,v 1.2 1997/07/09 01:08:24 millert Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996 by Internet Software Consortium. 4 * Copyright (c) 1996 by Internet Software Consortium.
@@ -278,7 +278,7 @@ b64_pton(src, target, targsize)
278 278
279 case 2: /* Valid, means one byte of info */ 279 case 2: /* Valid, means one byte of info */
280 /* Skip any number of spaces. */ 280 /* Skip any number of spaces. */
281 for (NULL; ch != '\0'; ch = *src++) 281 for (; ch != '\0'; ch = *src++)
282 if (!isspace(ch)) 282 if (!isspace(ch))
283 break; 283 break;
284 /* Make sure there is another trailing = sign. */ 284 /* Make sure there is another trailing = sign. */
@@ -293,7 +293,7 @@ b64_pton(src, target, targsize)
293 * We know this char is an =. Is there anything but 293 * We know this char is an =. Is there anything but
294 * whitespace after it? 294 * whitespace after it?
295 */ 295 */
296 for (NULL; ch != '\0'; ch = *src++) 296 for (; ch != '\0'; ch = *src++)
297 if (!isspace(ch)) 297 if (!isspace(ch))
298 return (-1); 298 return (-1);
299 299
diff --git a/src/lib/libc/net/gethostnamadr.c b/src/lib/libc/net/gethostnamadr.c
index 2cb69be722..266651b152 100644
--- a/src/lib/libc/net/gethostnamadr.c
+++ b/src/lib/libc/net/gethostnamadr.c
@@ -52,7 +52,7 @@
52 */ 52 */
53 53
54#if defined(LIBC_SCCS) && !defined(lint) 54#if defined(LIBC_SCCS) && !defined(lint)
55static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.25 1997/04/29 19:28:38 deraadt Exp $"; 55static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.26 1997/07/09 01:08:26 millert Exp $";
56#endif /* LIBC_SCCS and not lint */ 56#endif /* LIBC_SCCS and not lint */
57 57
58#include <sys/param.h> 58#include <sys/param.h>
@@ -769,7 +769,7 @@ _gethtent()
769 cp++; 769 cp++;
770 host.h_name = cp; 770 host.h_name = cp;
771 q = host.h_aliases = host_aliases; 771 q = host.h_aliases = host_aliases;
772 if (cp = strpbrk(cp, " \t")) 772 if ((cp = strpbrk(cp, " \t")))
773 *cp++ = '\0'; 773 *cp++ = '\0';
774 while (cp && *cp) { 774 while (cp && *cp) {
775 if (*cp == ' ' || *cp == '\t') { 775 if (*cp == ' ' || *cp == '\t') {
@@ -778,7 +778,7 @@ _gethtent()
778 } 778 }
779 if (q < &host_aliases[MAXALIASES - 1]) 779 if (q < &host_aliases[MAXALIASES - 1])
780 *q++ = cp; 780 *q++ = cp;
781 if (cp = strpbrk(cp, " \t")) 781 if ((cp = strpbrk(cp, " \t")))
782 *cp++ = '\0'; 782 *cp++ = '\0';
783 } 783 }
784 *q = NULL; 784 *q = NULL;
@@ -816,7 +816,7 @@ _gethtbyname2(name, af)
816 register char **cp; 816 register char **cp;
817 817
818 _sethtent(0); 818 _sethtent(0);
819 while (p = _gethtent()) { 819 while ((p = _gethtent())) {
820 if (p->h_addrtype != af) 820 if (p->h_addrtype != af)
821 continue; 821 continue;
822 if (strcasecmp(p->h_name, name) == 0) 822 if (strcasecmp(p->h_name, name) == 0)
@@ -838,7 +838,7 @@ _gethtbyaddr(addr, len, af)
838 register struct hostent *p; 838 register struct hostent *p;
839 839
840 _sethtent(0); 840 _sethtent(0);
841 while (p = _gethtent()) 841 while ((p = _gethtent()))
842 if (p->h_addrtype == af && !bcmp(p->h_addr, addr, len)) 842 if (p->h_addrtype == af && !bcmp(p->h_addr, addr, len))
843 break; 843 break;
844 _endhtent(); 844 _endhtent();
diff --git a/src/lib/libc/net/getnetbyaddr.c b/src/lib/libc/net/getnetbyaddr.c
index 76431a79a9..925d1d5895 100644
--- a/src/lib/libc/net/getnetbyaddr.c
+++ b/src/lib/libc/net/getnetbyaddr.c
@@ -32,7 +32,7 @@
32 */ 32 */
33 33
34#if defined(LIBC_SCCS) && !defined(lint) 34#if defined(LIBC_SCCS) && !defined(lint)
35static char rcsid[] = "$OpenBSD: getnetbyaddr.c,v 1.4 1997/04/05 21:13:06 millert Exp $"; 35static char rcsid[] = "$OpenBSD: getnetbyaddr.c,v 1.5 1997/07/09 01:08:28 millert Exp $";
36#endif /* LIBC_SCCS and not lint */ 36#endif /* LIBC_SCCS and not lint */
37 37
38#include <netdb.h> 38#include <netdb.h>
@@ -47,7 +47,7 @@ _getnetbyaddr(net, type)
47 register struct netent *p; 47 register struct netent *p;
48 48
49 setnetent(_net_stayopen); 49 setnetent(_net_stayopen);
50 while (p = getnetent()) 50 while ((p = getnetent()))
51 if (p->n_addrtype == type && p->n_net == net) 51 if (p->n_addrtype == type && p->n_net == net)
52 break; 52 break;
53 if (!_net_stayopen) 53 if (!_net_stayopen)
diff --git a/src/lib/libc/net/getnetbyname.c b/src/lib/libc/net/getnetbyname.c
index 764c78b361..4e39cf6860 100644
--- a/src/lib/libc/net/getnetbyname.c
+++ b/src/lib/libc/net/getnetbyname.c
@@ -32,7 +32,7 @@
32 */ 32 */
33 33
34#if defined(LIBC_SCCS) && !defined(lint) 34#if defined(LIBC_SCCS) && !defined(lint)
35static char rcsid[] = "$OpenBSD: getnetbyname.c,v 1.4 1997/03/13 19:07:26 downsj Exp $"; 35static char rcsid[] = "$OpenBSD: getnetbyname.c,v 1.5 1997/07/09 01:08:29 millert Exp $";
36#endif /* LIBC_SCCS and not lint */ 36#endif /* LIBC_SCCS and not lint */
37 37
38#include <netdb.h> 38#include <netdb.h>
@@ -48,7 +48,7 @@ _getnetbyname(name)
48 register char **cp; 48 register char **cp;
49 49
50 setnetent(_net_stayopen); 50 setnetent(_net_stayopen);
51 while (p = getnetent()) { 51 while ((p = getnetent())) {
52 if (strcasecmp(p->n_name, name) == 0) 52 if (strcasecmp(p->n_name, name) == 0)
53 break; 53 break;
54 for (cp = p->n_aliases; *cp != 0; cp++) 54 for (cp = p->n_aliases; *cp != 0; cp++)
diff --git a/src/lib/libc/net/getproto.c b/src/lib/libc/net/getproto.c
index 2af98dc38d..474d8d9427 100644
--- a/src/lib/libc/net/getproto.c
+++ b/src/lib/libc/net/getproto.c
@@ -32,7 +32,7 @@
32 */ 32 */
33 33
34#if defined(LIBC_SCCS) && !defined(lint) 34#if defined(LIBC_SCCS) && !defined(lint)
35static char rcsid[] = "$OpenBSD: getproto.c,v 1.2 1996/08/19 08:28:49 tholo Exp $"; 35static char rcsid[] = "$OpenBSD: getproto.c,v 1.3 1997/07/09 01:08:31 millert Exp $";
36#endif /* LIBC_SCCS and not lint */ 36#endif /* LIBC_SCCS and not lint */
37 37
38#include <netdb.h> 38#include <netdb.h>
@@ -46,7 +46,7 @@ getprotobynumber(proto)
46 register struct protoent *p; 46 register struct protoent *p;
47 47
48 setprotoent(_proto_stayopen); 48 setprotoent(_proto_stayopen);
49 while (p = getprotoent()) 49 while ((p = getprotoent()))
50 if (p->p_proto == proto) 50 if (p->p_proto == proto)
51 break; 51 break;
52 if (!_proto_stayopen) 52 if (!_proto_stayopen)
diff --git a/src/lib/libc/net/getprotoname.c b/src/lib/libc/net/getprotoname.c
index 0b057a5dd2..7a4e5fede5 100644
--- a/src/lib/libc/net/getprotoname.c
+++ b/src/lib/libc/net/getprotoname.c
@@ -32,7 +32,7 @@
32 */ 32 */
33 33
34#if defined(LIBC_SCCS) && !defined(lint) 34#if defined(LIBC_SCCS) && !defined(lint)
35static char rcsid[] = "$OpenBSD: getprotoname.c,v 1.2 1996/08/19 08:28:53 tholo Exp $"; 35static char rcsid[] = "$OpenBSD: getprotoname.c,v 1.3 1997/07/09 01:08:32 millert Exp $";
36#endif /* LIBC_SCCS and not lint */ 36#endif /* LIBC_SCCS and not lint */
37 37
38#include <netdb.h> 38#include <netdb.h>
@@ -48,7 +48,7 @@ getprotobyname(name)
48 register char **cp; 48 register char **cp;
49 49
50 setprotoent(_proto_stayopen); 50 setprotoent(_proto_stayopen);
51 while (p = getprotoent()) { 51 while ((p = getprotoent())) {
52 if (strcmp(p->p_name, name) == 0) 52 if (strcmp(p->p_name, name) == 0)
53 break; 53 break;
54 for (cp = p->p_aliases; *cp != 0; cp++) 54 for (cp = p->p_aliases; *cp != 0; cp++)
diff --git a/src/lib/libc/net/getservbyname.c b/src/lib/libc/net/getservbyname.c
index 269bc5c57a..25f0e27d06 100644
--- a/src/lib/libc/net/getservbyname.c
+++ b/src/lib/libc/net/getservbyname.c
@@ -32,7 +32,7 @@
32 */ 32 */
33 33
34#if defined(LIBC_SCCS) && !defined(lint) 34#if defined(LIBC_SCCS) && !defined(lint)
35static char rcsid[] = "$OpenBSD: getservbyname.c,v 1.2 1996/08/19 08:28:55 tholo Exp $"; 35static char rcsid[] = "$OpenBSD: getservbyname.c,v 1.3 1997/07/09 01:08:34 millert Exp $";
36#endif /* LIBC_SCCS and not lint */ 36#endif /* LIBC_SCCS and not lint */
37 37
38#include <netdb.h> 38#include <netdb.h>
@@ -48,7 +48,7 @@ getservbyname(name, proto)
48 register char **cp; 48 register char **cp;
49 49
50 setservent(_serv_stayopen); 50 setservent(_serv_stayopen);
51 while (p = getservent()) { 51 while ((p = getservent())) {
52 if (strcmp(name, p->s_name) == 0) 52 if (strcmp(name, p->s_name) == 0)
53 goto gotname; 53 goto gotname;
54 for (cp = p->s_aliases; *cp; cp++) 54 for (cp = p->s_aliases; *cp; cp++)
diff --git a/src/lib/libc/net/getservbyport.c b/src/lib/libc/net/getservbyport.c
index f1911e8dcd..4b063760d2 100644
--- a/src/lib/libc/net/getservbyport.c
+++ b/src/lib/libc/net/getservbyport.c
@@ -32,7 +32,7 @@
32 */ 32 */
33 33
34#if defined(LIBC_SCCS) && !defined(lint) 34#if defined(LIBC_SCCS) && !defined(lint)
35static char rcsid[] = "$OpenBSD: getservbyport.c,v 1.2 1996/08/19 08:28:57 tholo Exp $"; 35static char rcsid[] = "$OpenBSD: getservbyport.c,v 1.3 1997/07/09 01:08:35 millert Exp $";
36#endif /* LIBC_SCCS and not lint */ 36#endif /* LIBC_SCCS and not lint */
37 37
38#include <netdb.h> 38#include <netdb.h>
@@ -48,7 +48,7 @@ getservbyport(port, proto)
48 register struct servent *p; 48 register struct servent *p;
49 49
50 setservent(_serv_stayopen); 50 setservent(_serv_stayopen);
51 while (p = getservent()) { 51 while ((p = getservent())) {
52 if (p->s_port != port) 52 if (p->s_port != port)
53 continue; 53 continue;
54 if (proto == 0 || strcmp(p->s_proto, proto) == 0) 54 if (proto == 0 || strcmp(p->s_proto, proto) == 0)
diff --git a/src/lib/libc/net/inet_network.c b/src/lib/libc/net/inet_network.c
index a5360b7252..8a9a555d62 100644
--- a/src/lib/libc/net/inet_network.c
+++ b/src/lib/libc/net/inet_network.c
@@ -32,7 +32,7 @@
32 */ 32 */
33 33
34#if defined(LIBC_SCCS) && !defined(lint) 34#if defined(LIBC_SCCS) && !defined(lint)
35static char rcsid[] = "$OpenBSD: inet_network.c,v 1.6 1997/04/24 08:35:21 tholo Exp $"; 35static char rcsid[] = "$OpenBSD: inet_network.c,v 1.7 1997/07/09 01:08:37 millert Exp $";
36#endif /* LIBC_SCCS and not lint */ 36#endif /* LIBC_SCCS and not lint */
37 37
38#include <sys/types.h> 38#include <sys/types.h>
@@ -60,7 +60,7 @@ again:
60 base = 8, cp++; 60 base = 8, cp++;
61 if (*cp == 'x' || *cp == 'X') 61 if (*cp == 'x' || *cp == 'X')
62 base = 16, cp++; 62 base = 16, cp++;
63 while (c = *cp) { 63 while ((c = *cp)) {
64 if (isdigit(c)) { 64 if (isdigit(c)) {
65 val = (val * base) + (c - '0'); 65 val = (val * base) + (c - '0');
66 cp++; 66 cp++;
diff --git a/src/lib/libc/net/ipx_addr.c b/src/lib/libc/net/ipx_addr.c
index 96ee9d0fdb..a76e03e913 100644
--- a/src/lib/libc/net/ipx_addr.c
+++ b/src/lib/libc/net/ipx_addr.c
@@ -37,7 +37,7 @@
37 */ 37 */
38 38
39#if defined(LIBC_SCCS) && !defined(lint) 39#if defined(LIBC_SCCS) && !defined(lint)
40static char rcsid[] = "$OpenBSD: ipx_addr.c,v 1.2 1996/08/19 08:29:18 tholo Exp $"; 40static char rcsid[] = "$OpenBSD: ipx_addr.c,v 1.3 1997/07/09 01:08:39 millert Exp $";
41#endif /* LIBC_SCCS and not lint */ 41#endif /* LIBC_SCCS and not lint */
42 42
43#include <sys/param.h> 43#include <sys/param.h>
@@ -66,7 +66,7 @@ ipx_addr(name)
66 * form 2-272.AA001234H.01777, i.e. XDE standard. 66 * form 2-272.AA001234H.01777, i.e. XDE standard.
67 * Great efforts are made to insure backward compatability. 67 * Great efforts are made to insure backward compatability.
68 */ 68 */
69 if (hostname = strchr(buf, '#')) 69 if ((hostname = strchr(buf, '#')))
70 separator = '#'; 70 separator = '#';
71 else { 71 else {
72 hostname = strchr(buf, '.'); 72 hostname = strchr(buf, '.');
diff --git a/src/lib/libc/net/ns_addr.c b/src/lib/libc/net/ns_addr.c
index 96e01e2106..9a4483a209 100644
--- a/src/lib/libc/net/ns_addr.c
+++ b/src/lib/libc/net/ns_addr.c
@@ -35,7 +35,7 @@
35 */ 35 */
36 36
37#if defined(LIBC_SCCS) && !defined(lint) 37#if defined(LIBC_SCCS) && !defined(lint)
38static char rcsid[] = "$OpenBSD: ns_addr.c,v 1.2 1996/08/19 08:29:30 tholo Exp $"; 38static char rcsid[] = "$OpenBSD: ns_addr.c,v 1.3 1997/07/09 01:08:41 millert Exp $";
39#endif /* LIBC_SCCS and not lint */ 39#endif /* LIBC_SCCS and not lint */
40 40
41#include <sys/param.h> 41#include <sys/param.h>
@@ -64,7 +64,7 @@ ns_addr(name)
64 * form 2-272.AA001234H.01777, i.e. XDE standard. 64 * form 2-272.AA001234H.01777, i.e. XDE standard.
65 * Great efforts are made to insure backward compatability. 65 * Great efforts are made to insure backward compatability.
66 */ 66 */
67 if (hostname = strchr(buf, '#')) 67 if ((hostname = strchr(buf, '#')))
68 separator = '#'; 68 separator = '#';
69 else { 69 else {
70 hostname = strchr(buf, '.'); 70 hostname = strchr(buf, '.');
diff --git a/src/lib/libc/net/ns_ntoa.c b/src/lib/libc/net/ns_ntoa.c
index d65d6d84d8..472675e066 100644
--- a/src/lib/libc/net/ns_ntoa.c
+++ b/src/lib/libc/net/ns_ntoa.c
@@ -32,7 +32,7 @@
32 */ 32 */
33 33
34#if defined(LIBC_SCCS) && !defined(lint) 34#if defined(LIBC_SCCS) && !defined(lint)
35static char rcsid[] = "$OpenBSD: ns_ntoa.c,v 1.4 1997/04/05 21:13:15 millert Exp $"; 35static char rcsid[] = "$OpenBSD: ns_ntoa.c,v 1.5 1997/07/09 01:08:43 millert Exp $";
36#endif /* LIBC_SCCS and not lint */ 36#endif /* LIBC_SCCS and not lint */
37 37
38#include <sys/param.h> 38#include <sys/param.h>
@@ -54,7 +54,7 @@ ns_ntoa(addr)
54 u_char *uplim = up + 6; 54 u_char *uplim = up + 6;
55 55
56 net.net_e = addr.x_net; 56 net.net_e = addr.x_net;
57 sprintf(obuf, "%lx", ntohl(net.long_e)); 57 sprintf(obuf, "%x", ntohl(net.long_e));
58 cp = spectHex(obuf); 58 cp = spectHex(obuf);
59 cp2 = cp + 1; 59 cp2 = cp + 1;
60 while (*up==0 && up < uplim) up++; 60 while (*up==0 && up < uplim) up++;
diff --git a/src/lib/libc/net/nsap_addr.c b/src/lib/libc/net/nsap_addr.c
index e62d952a07..22a5f8d66e 100644
--- a/src/lib/libc/net/nsap_addr.c
+++ b/src/lib/libc/net/nsap_addr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: nsap_addr.c,v 1.3 1997/03/13 19:07:34 downsj Exp $ */ 1/* $OpenBSD: nsap_addr.c,v 1.4 1997/07/09 01:08:45 millert Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996 by Internet Software Consortium. 4 * Copyright (c) 1996 by Internet Software Consortium.
@@ -21,7 +21,7 @@
21#if 0 21#if 0
22static char rcsid[] = "$From: nsap_addr.c,v 8.3 1996/08/05 08:31:35 vixie Exp $"; 22static char rcsid[] = "$From: nsap_addr.c,v 8.3 1996/08/05 08:31:35 vixie Exp $";
23#else 23#else
24static char rcsid[] = "$OpenBSD: nsap_addr.c,v 1.3 1997/03/13 19:07:34 downsj Exp $"; 24static char rcsid[] = "$OpenBSD: nsap_addr.c,v 1.4 1997/07/09 01:08:45 millert Exp $";
25#endif 25#endif
26#endif /* LIBC_SCCS and not lint */ 26#endif /* LIBC_SCCS and not lint */
27 27
@@ -58,7 +58,7 @@ inet_nsap_addr(ascii, binary, maxlen)
58 c = toupper(c); 58 c = toupper(c);
59 if (isxdigit(c)) { 59 if (isxdigit(c)) {
60 nib = xtob(c); 60 nib = xtob(c);
61 if (c = *ascii++) { 61 if ((c = *ascii++)) {
62 c = toupper(c); 62 c = toupper(c);
63 if (isxdigit(c)) { 63 if (isxdigit(c)) {
64 *binary++ = (nib << 4) | xtob(c); 64 *binary++ = (nib << 4) | xtob(c);
diff --git a/src/lib/libc/net/rcmd.c b/src/lib/libc/net/rcmd.c
index 6e3ee93caf..4fbf602215 100644
--- a/src/lib/libc/net/rcmd.c
+++ b/src/lib/libc/net/rcmd.c
@@ -34,7 +34,7 @@
34 */ 34 */
35 35
36#if defined(LIBC_SCCS) && !defined(lint) 36#if defined(LIBC_SCCS) && !defined(lint)
37static char *rcsid = "$OpenBSD: rcmd.c,v 1.25 1997/07/06 07:55:58 deraadt Exp $"; 37static char *rcsid = "$OpenBSD: rcmd.c,v 1.26 1997/07/09 01:08:47 millert Exp $";
38#endif /* LIBC_SCCS and not lint */ 38#endif /* LIBC_SCCS and not lint */
39 39
40#include <sys/param.h> 40#include <sys/param.h>
@@ -55,6 +55,7 @@ static char *rcsid = "$OpenBSD: rcmd.c,v 1.25 1997/07/06 07:55:58 deraadt Exp $"
55#include <string.h> 55#include <string.h>
56#include <syslog.h> 56#include <syslog.h>
57#include <stdlib.h> 57#include <stdlib.h>
58#include <netgroup.h>
58 59
59int __ivaliduser __P((FILE *, in_addr_t, const char *, const char *)); 60int __ivaliduser __P((FILE *, in_addr_t, const char *, const char *));
60static int __icheckhost __P((u_int32_t, const char *)); 61static int __icheckhost __P((u_int32_t, const char *));
diff --git a/src/lib/libc/net/res_comp.c b/src/lib/libc/net/res_comp.c
index 030400d2a0..f7a0358967 100644
--- a/src/lib/libc/net/res_comp.c
+++ b/src/lib/libc/net/res_comp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: res_comp.c,v 1.7 1997/04/30 05:54:44 tholo Exp $ */ 1/* $OpenBSD: res_comp.c,v 1.8 1997/07/09 01:08:49 millert Exp $ */
2 2
3/* 3/*
4 * ++Copyright++ 1985, 1993 4 * ++Copyright++ 1985, 1993
@@ -60,7 +60,7 @@
60static char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93"; 60static char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93";
61static char rcsid[] = "$From: res_comp.c,v 8.11 1996/12/02 09:17:22 vixie Exp $"; 61static char rcsid[] = "$From: res_comp.c,v 8.11 1996/12/02 09:17:22 vixie Exp $";
62#else 62#else
63static char rcsid[] = "$OpenBSD: res_comp.c,v 1.7 1997/04/30 05:54:44 tholo Exp $"; 63static char rcsid[] = "$OpenBSD: res_comp.c,v 1.8 1997/07/09 01:08:49 millert Exp $";
64#endif 64#endif
65#endif /* LIBC_SCCS and not lint */ 65#endif /* LIBC_SCCS and not lint */
66 66
@@ -106,7 +106,7 @@ dn_expand(msg, eomorig, comp_dn, exp_dn, length)
106 /* 106 /*
107 * fetch next label in domain name 107 * fetch next label in domain name
108 */ 108 */
109 while (n = *cp++) { 109 while ((n = *cp++)) {
110 /* 110 /*
111 * Check for indirection 111 * Check for indirection
112 */ 112 */
@@ -306,7 +306,7 @@ dn_find(exp_dn, msg, dnptrs, lastdnptr)
306 for (cpp = dnptrs; cpp < lastdnptr; cpp++) { 306 for (cpp = dnptrs; cpp < lastdnptr; cpp++) {
307 dn = exp_dn; 307 dn = exp_dn;
308 sp = cp = *cpp; 308 sp = cp = *cpp;
309 while (n = *cp++) { 309 while ((n = *cp++)) {
310 /* 310 /*
311 * check for indirection 311 * check for indirection
312 */ 312 */
diff --git a/src/lib/libc/net/res_debug.c b/src/lib/libc/net/res_debug.c
index f002e11d7d..908ad421b7 100644
--- a/src/lib/libc/net/res_debug.c
+++ b/src/lib/libc/net/res_debug.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: res_debug.c,v 1.7 1997/04/30 05:54:43 tholo Exp $ */ 1/* $OpenBSD: res_debug.c,v 1.8 1997/07/09 01:08:51 millert Exp $ */
2 2
3/* 3/*
4 * ++Copyright++ 1985, 1990, 1993 4 * ++Copyright++ 1985, 1990, 1993
@@ -82,7 +82,7 @@
82static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93"; 82static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93";
83static char rcsid[] = "$From: res_debug.c,v 8.19 1996/11/26 10:11:23 vixie Exp $"; 83static char rcsid[] = "$From: res_debug.c,v 8.19 1996/11/26 10:11:23 vixie Exp $";
84#else 84#else
85static char rcsid[] = "$OpenBSD: res_debug.c,v 1.7 1997/04/30 05:54:43 tholo Exp $"; 85static char rcsid[] = "$OpenBSD: res_debug.c,v 1.8 1997/07/09 01:08:51 millert Exp $";
86#endif 86#endif
87#endif /* LIBC_SCCS and not lint */ 87#endif /* LIBC_SCCS and not lint */
88 88
@@ -201,7 +201,7 @@ do_rrset(msg, len, cp, cnt, pflag, file, hs)
201 * Print answer records. 201 * Print answer records.
202 */ 202 */
203 sflag = (_res.pfcode & pflag); 203 sflag = (_res.pfcode & pflag);
204 if (n = ntohs(cnt)) { 204 if ((n = ntohs(cnt))) {
205 if ((!_res.pfcode) || 205 if ((!_res.pfcode) ||
206 ((sflag) && (_res.pfcode & RES_PRF_HEAD1))) 206 ((sflag) && (_res.pfcode & RES_PRF_HEAD1)))
207 fprintf(file, hs); 207 fprintf(file, hs);
@@ -322,7 +322,7 @@ __fp_nquery(msg, len, file)
322 /* 322 /*
323 * Print question records. 323 * Print question records.
324 */ 324 */
325 if (n = ntohs(hp->qdcount)) { 325 if ((n = ntohs(hp->qdcount))) {
326 if ((!_res.pfcode) || (_res.pfcode & RES_PRF_QUES)) 326 if ((!_res.pfcode) || (_res.pfcode & RES_PRF_QUES))
327 fprintf(file, ";; QUESTIONS:\n"); 327 fprintf(file, ";; QUESTIONS:\n");
328 while (--n >= 0) { 328 while (--n >= 0) {
@@ -632,7 +632,7 @@ __p_rr(cp, msg, file)
632 cp2 = cp1 + dlen; 632 cp2 = cp1 + dlen;
633 while (cp < cp2) { 633 while (cp < cp2) {
634 putc('"', file); 634 putc('"', file);
635 if (n = (unsigned char) *cp++) { 635 if ((n = (unsigned char) *cp++)) {
636 for (c = n; c > 0 && cp < cp2; c--) { 636 for (c = n; c > 0 && cp < cp2; c--) {
637 if (strchr("\n\"\\", *cp)) 637 if (strchr("\n\"\\", *cp))
638 (void) putc('\\', file); 638 (void) putc('\\', file);
@@ -847,8 +847,8 @@ __p_rr(cp, msg, file)
847 putc('\n', file); 847 putc('\n', file);
848#endif 848#endif
849 if (cp - cp1 != dlen) { 849 if (cp - cp1 != dlen) {
850 fprintf(file, ";; packet size error (found %d, dlen was %d)\n", 850 fprintf(file, ";; packet size error (found %ld, dlen was %d)\n",
851 cp - cp1, dlen); 851 (long)(cp - cp1), dlen);
852 cp = NULL; 852 cp = NULL;
853 } 853 }
854 return (cp); 854 return (cp);
@@ -929,7 +929,7 @@ __sym_ston(syms, name, success)
929 char *name; 929 char *name;
930 int *success; 930 int *success;
931{ 931{
932 for (NULL; syms->name != 0; syms++) { 932 for (; syms->name != 0; syms++) {
933 if (strcasecmp (name, syms->name) == 0) { 933 if (strcasecmp (name, syms->name) == 0) {
934 if (success) 934 if (success)
935 *success = 1; 935 *success = 1;
@@ -949,7 +949,7 @@ __sym_ntos(syms, number, success)
949{ 949{
950 static char unname[20]; 950 static char unname[20];
951 951
952 for (NULL; syms->name != 0; syms++) { 952 for (; syms->name != 0; syms++) {
953 if (number == syms->number) { 953 if (number == syms->number) {
954 if (success) 954 if (success)
955 *success = 1; 955 *success = 1;
@@ -972,7 +972,7 @@ __sym_ntop(syms, number, success)
972{ 972{
973 static char unname[20]; 973 static char unname[20];
974 974
975 for (NULL; syms->name != 0; syms++) { 975 for (; syms->name != 0; syms++) {
976 if (number == syms->number) { 976 if (number == syms->number) {
977 if (success) 977 if (success)
978 *success = 1; 978 *success = 1;
diff --git a/src/lib/libc/net/res_query.c b/src/lib/libc/net/res_query.c
index 4f3665f276..2e245b78cc 100644
--- a/src/lib/libc/net/res_query.c
+++ b/src/lib/libc/net/res_query.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: res_query.c,v 1.9 1997/04/06 07:55:04 deraadt Exp $ */ 1/* $OpenBSD: res_query.c,v 1.10 1997/07/09 01:08:53 millert Exp $ */
2 2
3/* 3/*
4 * ++Copyright++ 1988, 1993 4 * ++Copyright++ 1988, 1993
@@ -60,7 +60,7 @@
60static char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93"; 60static char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93";
61static char rcsid[] = "$From: res_query.c,v 8.9 1996/09/22 00:13:28 vixie Exp $"; 61static char rcsid[] = "$From: res_query.c,v 8.9 1996/09/22 00:13:28 vixie Exp $";
62#else 62#else
63static char rcsid[] = "$OpenBSD: res_query.c,v 1.9 1997/04/06 07:55:04 deraadt Exp $"; 63static char rcsid[] = "$OpenBSD: res_query.c,v 1.10 1997/07/09 01:08:53 millert Exp $";
64#endif 64#endif
65#endif /* LIBC_SCCS and not lint */ 65#endif /* LIBC_SCCS and not lint */
66 66
@@ -77,6 +77,7 @@ static char rcsid[] = "$OpenBSD: res_query.c,v 1.9 1997/04/06 07:55:04 deraadt E
77#include <errno.h> 77#include <errno.h>
78#include <stdlib.h> 78#include <stdlib.h>
79#include <string.h> 79#include <string.h>
80#include <unistd.h>
80 81
81#if PACKETSZ > 1024 82#if PACKETSZ > 1024
82#define MAXPACKET PACKETSZ 83#define MAXPACKET PACKETSZ