commit 7727530b534581f64ff00d1bc41b3198103e5e11
parent bc0de5e7e541a6fc45774ac3a03248c2a533f9cf
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sun, 23 Mar 2014 12:23:56 +0100
crypt: dont error out if a file in a series fails
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/util/crypt.c b/util/crypt.c
@@ -16,8 +16,10 @@ cryptmain(int argc, char *argv[],
mdprint(md, "<stdin>", sz);
} else {
for (; argc > 0; argc--) {
- if ((fp = fopen(*argv, "r")) == NULL)
- eprintf("fopen %s:", *argv);
+ if((fp = fopen(*argv, "r")) == NULL) {
+ weprintf("fopen %s:", *argv);
+ continue;
+ }
cryptsum(ops, fp, *argv, md);
mdprint(md, *argv, sz);
fclose(fp);
@@ -38,7 +40,7 @@ cryptsum(struct crypt_ops *ops, FILE *fp, const char *f,
while ((n = fread(buf, 1, sizeof(buf), fp)) > 0)
ops->update(ops->s, buf, n);
if (ferror(fp)) {
- eprintf("%s: read error:", f);
+ eprintf("read error: %s:", f);
return 1;
}
ops->sum(ops->s, md);