dsig.c: Allow precomputed hashes to be read from a file.
[u/mdw/catacomb] / hashsum.c
index 23b5d56..d12c506 100644 (file)
--- a/hashsum.c
+++ b/hashsum.c
@@ -113,6 +113,11 @@ static int checkhash(const gchash *gch, unsigned f,
     }
   }
 
+  if (ferror(hfp.fp)) {
+    moan("error reading input `%s': %s",
+        file ? file : "<stdin>", strerror(errno));
+    rc = EXIT_FAILURE;
+  }
   dstr_destroy(&dl);
   dstr_destroy(&df);
   xfree(hfp.hbuf);
@@ -236,7 +241,7 @@ int main(int argc, char *argv[])
 {
   unsigned f = 0;
   const gchash *gch = 0;
-  const encodeops *e = &encodingtab[0];
+  const encodeops *e = &encodingtab[ENC_HEX];
   int rc;
 
   /* --- Initialization --- */