summaryrefslogtreecommitdiff
path: root/bin/md5
diff options
context:
space:
mode:
authorCharles Longeau <chl@cvs.openbsd.org>2007-11-07 09:52:26 +0000
committerCharles Longeau <chl@cvs.openbsd.org>2007-11-07 09:52:26 +0000
commit33911f4a5c28457f5e23e7f6f60d7f0fe97f0bbd (patch)
treeccd8ce0034162d11e03fc966cd12e57db783d4b3 /bin/md5
parent9cc8cd0dae516696d672f02d42759f56dd54dffe (diff)
properly exit >0 when encountering bad md5 in cheklist
ok gilles@ millert@ From Tim van der Molen <tbvdm.lists at xs4all.nl>
Diffstat (limited to 'bin/md5')
-rw-r--r--bin/md5/md5.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/md5/md5.c b/bin/md5/md5.c
index 3e128819d0b..d26900e99f1 100644
--- a/bin/md5/md5.c
+++ b/bin/md5/md5.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: md5.c,v 1.47 2007/10/31 20:47:39 deraadt Exp $ */
+/* $OpenBSD: md5.c,v 1.48 2007/11/07 09:52:25 chl Exp $ */
/*
* Copyright (c) 2001,2003,2005-2006 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -499,7 +499,7 @@ digest_file(const char *file, struct hash_list *hl, int echo)
int
digest_filelist(const char *file, struct hash_function *defhash)
{
- int fd, found, base64, error;
+ int fd, found, base64, error, cmp;
size_t algorithm_max, algorithm_min;
const char *algorithm;
char *filename, *checksum, *buf, *p;
@@ -644,10 +644,10 @@ digest_filelist(const char *file, struct hash_function *defhash)
digest_end(hf, &context, digest, sizeof(digest), base64);
if (base64)
- error = strncmp(checksum, digest, len);
+ cmp = strncmp(checksum, digest, len);
else
- error = strcasecmp(checksum, digest);
- if (error == 0) {
+ cmp = strcasecmp(checksum, digest);
+ if (cmp == 0) {
if (qflag == 0)
(void)printf("(%s) %s: OK\n", algorithm, filename);
} else {