summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1997-06-03 22:43:42 +0000
committerderaadt <deraadt@openbsd.org>1997-06-03 22:43:42 +0000
commit8061bb022735b1465967d1f2aa9cf69a0759f610 (patch)
treea7de57e22df2df56d81a96a7abfed1d4d1da4144 /lib/libc
parentMake mkfs.c malloc its large buffers, which saves about 200K of bss size (diff)
downloadwireguard-openbsd-8061bb022735b1465967d1f2aa9cf69a0759f610.tar.xz
wireguard-openbsd-8061bb022735b1465967d1f2aa9cf69a0759f610.zip
howmany(x+1, NFDBITS)
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/net/rcmd.c4
-rw-r--r--lib/libc/net/res_send.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c
index 3c483a809bf..468c93eb637 100644
--- a/lib/libc/net/rcmd.c
+++ b/lib/libc/net/rcmd.c
@@ -34,7 +34,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: rcmd.c,v 1.21 1997/05/28 21:40:11 deraadt Exp $";
+static char *rcsid = "$OpenBSD: rcmd.c,v 1.22 1997/06/03 22:43:42 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -166,7 +166,7 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
if (s2 < 0)
goto bad;
- readsp = (fd_set *)malloc(howmany(MAX(s, s2), NFDBITS) *
+ readsp = (fd_set *)malloc(howmany(MAX(s, s2)+1, NFDBITS) *
sizeof(fd_mask));
if (readsp == NULL)
goto bad;
diff --git a/lib/libc/net/res_send.c b/lib/libc/net/res_send.c
index 284f85d7fe9..0456dc0cf14 100644
--- a/lib/libc/net/res_send.c
+++ b/lib/libc/net/res_send.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_send.c,v 1.5 1997/05/28 21:38:57 deraadt Exp $ */
+/* $OpenBSD: res_send.c,v 1.6 1997/06/03 22:43:43 deraadt Exp $ */
/*
* ++Copyright++ 1985, 1989, 1993
@@ -60,7 +60,7 @@
static char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
static char rcsid[] = "$From: res_send.c,v 8.12 1996/10/08 04:51:06 vixie Exp $";
#else
-static char rcsid[] = "$OpenBSD: res_send.c,v 1.5 1997/05/28 21:38:57 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: res_send.c,v 1.6 1997/06/03 22:43:43 deraadt Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -595,7 +595,7 @@ read_len:
timeout.tv_sec = 1;
timeout.tv_usec = 0;
wait:
- dsmaskp = (fd_set *)malloc(howmany(s, NFDBITS) *
+ dsmaskp = (fd_set *)malloc(howmany(s+1, NFDBITS) *
sizeof(fd_mask));
if (dsmaskp == NULL) {
res_close();