aboutsummaryrefslogtreecommitdiff
path: root/sbin/md5/md5.c
diff options
context:
space:
mode:
authorPhilippe Charnier <charnier@FreeBSD.org>1998-07-06 07:04:50 +0000
committerPhilippe Charnier <charnier@FreeBSD.org>1998-07-06 07:04:50 +0000
commit23b5892f5e3a21699ad309d3d3c8e06e89d3fa1a (patch)
tree756fb00a12d075d517c449f91a6b2b517a3425c1 /sbin/md5/md5.c
parentb50d7fae67bedc832bea70ecc10fb8f30eb3bb61 (diff)
downloadsrc-23b5892f5e3a21699ad309d3d3c8e06e89d3fa1a.tar.gz
src-23b5892f5e3a21699ad309d3d3c8e06e89d3fa1a.zip
Correct use of .Nm. Spelling. Add rcsid, remove unused #includes, use err(3).
Notes
Notes: svn path=/head/; revision=37421
Diffstat (limited to 'sbin/md5/md5.c')
-rw-r--r--sbin/md5/md5.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/sbin/md5/md5.c b/sbin/md5/md5.c
index dda9e753ceca..599089408c65 100644
--- a/sbin/md5/md5.c
+++ b/sbin/md5/md5.c
@@ -1,10 +1,6 @@
/*
- * $Id: md5.c,v 1.11 1997/12/29 03:40:37 steve Exp $
- *
* Derived from:
- */
-
-/*
+ *
* MDDRIVER.C - test driver for MD2, MD4 and MD5
*/
@@ -21,11 +17,15 @@
* documentation and/or software.
*/
+#ifndef lint
+static const char rcsid[] =
+ "$Id$";
+#endif /* not lint */
+
#include <sys/types.h>
+#include <err.h>
#include <md5.h>
-
#include <stdio.h>
-#include <string.h>
#include <time.h>
#include <unistd.h>
@@ -83,7 +83,7 @@ main(argc, argv)
while (optind < argc) {
p = MD5File(argv[optind], buf);
if (!p)
- perror(argv[optind]);
+ warn("%s", argv[optind]);
else
printf("MD5 (%s) = %s\n", argv[optind], p);
optind++;
@@ -181,10 +181,8 @@ MDFilter(pipe)
MD5Init(&context);
while ((len = fread(buffer, 1, BUFSIZ, stdin))) {
- if(pipe && (len != fwrite(buffer, 1, len, stdout))) {
- perror("stdout");
- exit(1);
- }
+ if(pipe && (len != fwrite(buffer, 1, len, stdout)))
+ err(1, "stdout");
MD5Update(&context, buffer, len);
}
printf("%s\n", MD5End(&context,buf));