too many args is a usage error
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 24 Apr 1992 09:06:52 +0000 (01:06 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 24 Apr 1992 09:06:52 +0000 (01:06 -0800)
SCCS-vsn: usr.sbin/kvm_mkdb/kvm_mkdb.c 5.13

usr/src/usr.sbin/kvm_mkdb/kvm_mkdb.c

index 8682d14..0ff8149 100644 (file)
@@ -12,7 +12,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)kvm_mkdb.c 5.12 (Berkeley) %G%";
+static char sccsid[] = "@(#)kvm_mkdb.c 5.13 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -45,6 +45,9 @@ main(argc, argv)
        argc -= optind;
        argv += optind;
 
        argc -= optind;
        argv += optind;
 
+       if (argc > 1)
+               usage();
+
        nlistpath = argc > 1 ? argv[0] : _PATH_UNIX;
        nlistname = basename(nlistpath);
 
        nlistpath = argc > 1 ? argv[0] : _PATH_UNIX;
        nlistname = basename(nlistpath);