summaryrefslogtreecommitdiffstats
path: root/usr.bin/whereis/whereis.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/whereis/whereis.c')
-rw-r--r--usr.bin/whereis/whereis.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/whereis/whereis.c b/usr.bin/whereis/whereis.c
index 8c75f5e..4e39cda 100644
--- a/usr.bin/whereis/whereis.c
+++ b/usr.bin/whereis/whereis.c
@@ -38,7 +38,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)whereis.c 8.1 (Berkeley) 6/6/93";
+static char sccsid[] = "@(#)whereis.c 8.3 (Berkeley) 5/4/95";
#endif /* not lint */
#include <sys/param.h>
@@ -50,6 +50,7 @@ static char sccsid[] = "@(#)whereis.c 8.1 (Berkeley) 6/6/93";
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
void usage __P((void));
@@ -72,6 +73,9 @@ main(argc, argv)
argc -= optind;
argv += optind;
+ if (argc == 0)
+ usage();
+
/* Retrieve the standard path. */
mib[0] = CTL_USER;
mib[1] = USER_CS_PATH;
@@ -110,6 +114,7 @@ main(argc, argv)
void
usage()
{
- (void)fprintf(stderr, "whereis: program ...\n");
+
+ (void)fprintf(stderr, "usage: whereis program [...]\n");
exit (1);
}
OpenPOWER on IntegriCloud