diff options
author | obrien <obrien@FreeBSD.org> | 1997-11-09 05:35:26 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 1997-11-09 05:35:26 +0000 |
commit | 2a24ee7edf04219390b1d77cb39c88a6b6bd77e4 (patch) | |
tree | 3bdb57775583cd42a8f4a771f513e12ef051e1ea | |
parent | b820ab98456bfa33c0920604b7f8d49bc85785f9 (diff) | |
download | FreeBSD-src-2a24ee7edf04219390b1d77cb39c88a6b6bd77e4.zip FreeBSD-src-2a24ee7edf04219390b1d77cb39c88a6b6bd77e4.tar.gz |
When called "sum", it is not documented as accepting any arguments.
-rw-r--r-- | usr.bin/cksum/cksum.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/usr.bin/cksum/cksum.c b/usr.bin/cksum/cksum.c index 7a0e4b8..4c654cb 100644 --- a/usr.bin/cksum/cksum.c +++ b/usr.bin/cksum/cksum.c @@ -45,7 +45,7 @@ static const char copyright[] = static char sccsid[] = "@(#)cksum.c 8.2 (Berkeley) 4/28/95"; #endif static const char rcsid[] = - "$Id: cksum.c,v 1.5 1997/07/06 03:18:13 bde Exp $"; + "$Id: cksum.c,v 1.6 1997/09/26 08:02:17 phk Exp $"; #endif /* not lint */ #include <sys/cdefs.h> @@ -84,31 +84,31 @@ main(argc, argv) } else { cfncn = crc; pfncn = pcrc; - } - while ((ch = getopt(argc, argv, "o:")) != -1) - switch (ch) { - case 'o': - if (!strcmp(optarg, "1")) { - cfncn = csum1; - pfncn = psum1; - } else if (!strcmp(optarg, "2")) { - cfncn = csum2; - pfncn = psum2; - } else if (*optarg == '3') { - cfncn = crc32; - pfncn = pcrc; - } else { - warnx("illegal argument to -o option"); + while ((ch = getopt(argc, argv, "o:")) != -1) + switch (ch) { + case 'o': + if (!strcmp(optarg, "1")) { + cfncn = csum1; + pfncn = psum1; + } else if (!strcmp(optarg, "2")) { + cfncn = csum2; + pfncn = psum2; + } else if (*optarg == '3') { + cfncn = crc32; + pfncn = pcrc; + } else { + warnx("illegal argument to -o option"); + usage(); + } + break; + case '?': + default: usage(); } - break; - case '?': - default: - usage(); - } - argc -= optind; - argv += optind; + argc -= optind; + argv += optind; + } fd = STDIN_FILENO; fn = NULL; |