Message buffer passed to kvm_openfiles() should _POSIX2_LINE_MAX long; PR#3266

This commit is contained in:
explorer 1997-03-03 22:12:19 +00:00
parent 4f5b043d6d
commit a030e0a1ae
2 changed files with 8 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.9 1996/12/13 19:26:21 scottr Exp $ */
/* $NetBSD: main.c,v 1.10 1997/03/03 22:19:37 explorer Exp $ */
/*-
* Copyright (c) 1980, 1992, 1993
@ -43,12 +43,13 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
#endif
static char rcsid[] = "$NetBSD: main.c,v 1.9 1996/12/13 19:26:21 scottr Exp $";
static char rcsid[] = "$NetBSD: main.c,v 1.10 1997/03/03 22:19:37 explorer Exp $";
#endif /* not lint */
#include <sys/param.h>
#include <err.h>
#include <limits.h>
#include <nlist.h>
#include <signal.h>
#include <stdio.h>
@ -93,7 +94,7 @@ main(argc, argv)
char **argv;
{
int ch;
char errbuf[80];
char errbuf[_POSIX2_LINE_MAX];
while ((ch = getopt(argc, argv, "M:N:w:")) != EOF)
switch(ch) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: w.c,v 1.19 1997/01/09 11:55:19 tls Exp $ */
/* $NetBSD: w.c,v 1.20 1997/03/03 22:12:19 explorer Exp $ */
/*-
* Copyright (c) 1980, 1991, 1993, 1994
@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)w.c 8.6 (Berkeley) 6/30/94";
#else
static char rcsid[] = "$NetBSD: w.c,v 1.19 1997/01/09 11:55:19 tls Exp $";
static char rcsid[] = "$NetBSD: w.c,v 1.20 1997/03/03 22:12:19 explorer Exp $";
#endif
#endif /* not lint */
@ -72,6 +72,7 @@ static char rcsid[] = "$NetBSD: w.c,v 1.19 1997/01/09 11:55:19 tls Exp $";
#include <errno.h>
#include <fcntl.h>
#include <kvm.h>
#include <limits.h>
#include <netdb.h>
#include <nlist.h>
#include <paths.h>
@ -129,7 +130,7 @@ main(argc, argv)
u_long l;
int ch, i, nentries, nusers, wcmd;
char *memf, *nlistf, *p, *x;
char buf[MAXHOSTNAMELEN], errbuf[256];
char buf[MAXHOSTNAMELEN], errbuf[_POSIX2_LINE_MAX];
/* Are we w(1) or uptime(1)? */
p = __progname;