diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2007-03-29 13:02:18 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2007-03-29 13:02:18 +0000 |
commit | a190246b78c841d125f40b05d20127311b25625d (patch) | |
tree | aba8accdcee91cc8e3cf003785eff0281ead34c4 | |
parent | 906cf885e1752ddc636b09942318286ecdc16d3c (diff) |
Do not print a warning that no valid checksums were found if there
was a single fingerprint for a file that could not be opened.
The warning that the file could not be opened is sufficient.
From espie@
-rw-r--r-- | bin/md5/md5.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/md5/md5.c b/bin/md5/md5.c index e0f45aaaaba..c6dc42468d0 100644 --- a/bin/md5/md5.c +++ b/bin/md5/md5.c @@ -1,4 +1,4 @@ -/* $OpenBSD: md5.c,v 1.42 2007/03/28 11:30:15 millert Exp $ */ +/* $OpenBSD: md5.c,v 1.43 2007/03/29 13:02:17 millert Exp $ */ /* * Copyright (c) 2001,2003,2005-2006 Todd C. Miller <Todd.Miller@courtesan.com> @@ -526,8 +526,9 @@ digest_filelist(const char *file, struct hash_function *defhash) algorithm_min = MIN(algorithm_min, len); } - base64 = error = found = 0; + error = found = 0; while ((buf = fgetln(fp, &len))) { + base64 = 0; if (buf[len - 1] == '\n') buf[len - 1] = '\0'; else { @@ -614,6 +615,7 @@ digest_filelist(const char *file, struct hash_function *defhash) if (p != NULL) *p = '\0'; } + found = 1; if ((fd = open(filename, O_RDONLY, 0)) == -1) { warn("cannot open %s", filename); @@ -622,7 +624,6 @@ digest_filelist(const char *file, struct hash_function *defhash) continue; } - found = 1; hf->init(&context); while ((nread = read(fd, data, sizeof(data))) > 0) hf->update(&context, data, (unsigned int)nread); |