X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/0f00dc4c8eb47e67bc0f148c2dd109f73a451e0a..8c5956c14f5834a072e1a9345ae1f356b14164ca:/progs/hashsum.c diff --git a/progs/hashsum.c b/progs/hashsum.c index 8cc19265..df1fdaea 100644 --- a/progs/hashsum.c +++ b/progs/hashsum.c @@ -90,7 +90,7 @@ static int warnjunk(const char *path, const struct stat *st, void *p) static int checkhash(fhashstate *fh, const char *file, const encodeops *e) { - int rc; + int rc = 0; hfpctx hfp; dstr dl = DSTR_INIT; dstr df = DSTR_INIT; @@ -116,6 +116,7 @@ static int checkhash(fhashstate *fh, const char *file, const encodeops *e) case HF_HASH: xfree(hfp.hbuf); hfp.hbuf = xmalloc(2 * hfp.gch->hashsz); + fh->gch = hfp.gch; break; case HF_FILE: if (fhash(fh, df.buf, hfp.hbuf + hfp.gch->hashsz)) {