NULL dereference; bug report 4.3BSD/usr.lib/59
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 15 Sep 1987 05:52:00 +0000 (21:52 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Tue, 15 Sep 1987 05:52:00 +0000 (21:52 -0800)
SCCS-vsn: usr.sbin/lpr/lpc/lpc.c 5.3

usr/src/usr.sbin/lpr/lpc/lpc.c

index ecc47e3..f3e62b4 100644 (file)
@@ -11,7 +11,7 @@ char copyright[] =
 #endif not lint
 
 #ifndef lint
 #endif not lint
 
 #ifndef lint
-static char sccsid[] = "@(#)lpc.c      5.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)lpc.c      5.3 (Berkeley) %G%";
 #endif not lint
 
 /*
 #endif not lint
 
 /*
@@ -190,7 +190,7 @@ help(argc, argv)
                extern int NCMDS;
 
                printf("Commands may be abbreviated.  Commands are:\n\n");
                extern int NCMDS;
 
                printf("Commands may be abbreviated.  Commands are:\n\n");
-               for (c = cmdtab; c < &cmdtab[NCMDS]; c++) {
+               for (c = cmdtab; c < &cmdtab[NCMDS - 1]; c++) {
                        int len = strlen(c->c_name);
 
                        if (len > width)
                        int len = strlen(c->c_name);
 
                        if (len > width)