[hackers] [sbase] crypt: dont error out if a file in a series fails || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Sun, 23 Mar 2014 13:27:22 +0100

commit 7727530b534581f64ff00d1bc41b3198103e5e11
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sun Mar 23 12:23:56 2014 +0100

    crypt: dont error out if a file in a series fails
    
    Signed-off-by: Hiltjo Posthuma <hiltjo_AT_codemadness.org>

diff --git a/util/crypt.c b/util/crypt.c
index ca0e258..5787def 100644
--- a/util/crypt.c
+++ b/util/crypt.c
_AT_@ -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);
_AT_@ -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);
Received on Sun Mar 23 2014 - 13:27:22 CET

This archive was generated by hypermail 2.3.0 : Sun Mar 23 2014 - 13:36:15 CET