crypt: dont error out if a file in a series fails
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
This commit is contained in:
parent
bc0de5e7e5
commit
7727530b53
|
@ -16,8 +16,10 @@ cryptmain(int argc, char *argv[],
|
||||||
mdprint(md, "<stdin>", sz);
|
mdprint(md, "<stdin>", sz);
|
||||||
} else {
|
} else {
|
||||||
for (; argc > 0; argc--) {
|
for (; argc > 0; argc--) {
|
||||||
if ((fp = fopen(*argv, "r")) == NULL)
|
if((fp = fopen(*argv, "r")) == NULL) {
|
||||||
eprintf("fopen %s:", *argv);
|
weprintf("fopen %s:", *argv);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
cryptsum(ops, fp, *argv, md);
|
cryptsum(ops, fp, *argv, md);
|
||||||
mdprint(md, *argv, sz);
|
mdprint(md, *argv, sz);
|
||||||
fclose(fp);
|
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)
|
while ((n = fread(buf, 1, sizeof(buf), fp)) > 0)
|
||||||
ops->update(ops->s, buf, n);
|
ops->update(ops->s, buf, n);
|
||||||
if (ferror(fp)) {
|
if (ferror(fp)) {
|
||||||
eprintf("%s: read error:", f);
|
eprintf("read error: %s:", f);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
ops->sum(ops->s, md);
|
ops->sum(ops->s, md);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user