X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/f377eee1983a7c9f33a9920b3bf16180dca909da..95d9246390251adba7e6e9f0cc70bf0ebe0b2e60:/hashsum.c diff --git a/hashsum.c b/hashsum.c index 23b5d56..d12c506 100644 --- 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 : "", 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 --- */