summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-06-03 22:43:44 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-06-03 22:43:44 +0000
commit276b053ffc3f8334fe27ac5b74263ebb1c184269 (patch)
tree0ae8330898e62d255803688231f455bd5bb9da66 /lib/libc
parent21f117e966e81a6c58ee586a79c5e544043a654d (diff)
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();