summaryrefslogtreecommitdiff
path: root/bin/md5
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1996-11-24 02:26:01 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1996-11-24 02:26:01 +0000
commit6388d3d9cf07f4ef99b2149951cb5533a69f8912 (patch)
treeebc1a9ef18f305b2559289da5f10ca04db7bddb6 /bin/md5
parent2cc34713ef2a7401726ee17cc4419cee9b170cab (diff)
64-bit cleanup + pedantic -W flags
Diffstat (limited to 'bin/md5')
-rw-r--r--bin/md5/Makefile5
-rw-r--r--bin/md5/md5.c14
2 files changed, 11 insertions, 8 deletions
diff --git a/bin/md5/Makefile b/bin/md5/Makefile
index 62fccb4c23e..46e59bf216c 100644
--- a/bin/md5/Makefile
+++ b/bin/md5/Makefile
@@ -1,7 +1,8 @@
-# $OpenBSD: Makefile,v 1.2 1996/11/12 23:33:01 niklas Exp $
+# $OpenBSD: Makefile,v 1.3 1996/11/24 02:26:00 niklas Exp $
PROG= md5
SRCS= md5.c
-COPTS+= -Wall
+COPTS+= -Wall -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Werror \
+ -DPROTOTYPES
.include <bsd.prog.mk>
diff --git a/bin/md5/md5.c b/bin/md5/md5.c
index 5f0d6fbc251..994cbce4df8 100644
--- a/bin/md5/md5.c
+++ b/bin/md5/md5.c
@@ -1,5 +1,5 @@
/*
- * $OpenBSD: md5.c,v 1.2 1996/11/12 23:33:02 niklas Exp $
+ * $OpenBSD: md5.c,v 1.3 1996/11/24 02:26:00 niklas Exp $
*
* Derived from:
*/
@@ -38,6 +38,8 @@ static void MDTimeTrial PROTO_LIST((void));
static void MDTestSuite PROTO_LIST((void));
static void MDFilter PROTO_LIST((int));
+int main PROTO_LIST((int, char *[]));
+
/* Main driver.
Arguments (may be any combination):
@@ -85,7 +87,7 @@ static void
MDString(string)
char *string;
{
- unsigned int len = strlen(string);
+ size_t len = strlen(string);
char buf[33];
printf("MD5 (\"%s\") = %s\n", string, MD5Data(string, len, buf));
@@ -116,7 +118,7 @@ MDTimeTrial()
/* Digest blocks */
MD5Init(&context);
for (i = 0; i < TEST_BLOCK_COUNT; i++)
- MD5Update(&context, block, TEST_BLOCK_LEN);
+ MD5Update(&context, block, (size_t)TEST_BLOCK_LEN);
p = MD5End(&context,buf);
/* Stop timer */
@@ -158,13 +160,13 @@ static void
MDFilter(int pipe)
{
MD5_CTX context;
- int len;
+ size_t len;
unsigned char buffer[BUFSIZ];
char buf[33];
MD5Init(&context);
- while ((len = fread(buffer, 1, BUFSIZ, stdin)) > 0) {
- if(pipe && (len != fwrite(buffer, 1, len, stdout))) {
+ while ((len = fread(buffer, (size_t)1, (size_t)BUFSIZ, stdin)) > 0) {
+ if(pipe && (len != fwrite(buffer, (size_t)1, len, stdout))) {
perror("stdout");
exit(1);
}