summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-03-19 23:54:42 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-03-19 23:54:42 +0000
commit8646b82d5cecf48ca1a0d1fb4f291252baee2a46 (patch)
tree910f1dc59bb971e8cad0a9e091722c9b5b0bb53c
parent4616ad8a96f282e9d3408fd568f27107a672c149 (diff)
Fix unitialized variable in non-setgid case; Gregory Steuck
-rw-r--r--bin/ps/print.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c
index 435ad6d7e90..f709390af20 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print.c,v 1.25 2002/02/16 21:27:07 millert Exp $ */
+/* $OpenBSD: print.c,v 1.26 2002/03/19 23:54:41 millert Exp $ */
/* $NetBSD: print.c,v 1.27 1995/09/29 21:58:12 cgd Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
#else
-static char rcsid[] = "$OpenBSD: print.c,v 1.25 2002/02/16 21:27:07 millert Exp $";
+static char rcsid[] = "$OpenBSD: print.c,v 1.26 2002/03/19 23:54:41 millert Exp $";
#endif
#endif /* not lint */
@@ -132,7 +132,8 @@ command(ki, ve)
fmt_putc(' ', &left);
}
}
- }
+ } else
+ argv = NULL;
if (needcomm) {
if (!commandonly) {
if (kd != NULL) {
@@ -145,7 +146,7 @@ command(ki, ve)
}
}
}
- if (argv == 0 || argv[0] == 0 ||
+ if (argv == NULL || argv[0] == '\0' ||
strcmp(cmdpart(argv[0]), KI_PROC(ki)->p_comm)) {
fmt_putc('(', &left);
fmt_puts(KI_PROC(ki)->p_comm, &left);