don't bsearch() the null entry.
authorRalph Campbell <ralph@ucbvax.Berkeley.EDU>
Mon, 2 Mar 1992 12:53:11 +0000 (04:53 -0800)
committerRalph Campbell <ralph@ucbvax.Berkeley.EDU>
Mon, 2 Mar 1992 12:53:11 +0000 (04:53 -0800)
SCCS-vsn: bin/ps/keyword.c 5.11

usr/src/bin/ps/keyword.c

index f191444..1fcd18c 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)keyword.c  5.10 (Berkeley) %G%";
+static char sccsid[] = "@(#)keyword.c  5.11 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -304,7 +304,7 @@ findvar(p)
 
        key.name = p;
        v = (VAR *)bsearch(&key, var,
 
        key.name = p;
        v = (VAR *)bsearch(&key, var,
-           sizeof(var)/sizeof(VAR), sizeof(VAR), vcmp);
+               sizeof(var)/sizeof(VAR) - 1, sizeof(VAR), vcmp);
 
        if (v && v->alias) {
                if (hp) {
 
        if (v && v->alias) {
                if (hp) {