chiark
/
gitweb
/
~mdw
/
catacomb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a5591f9
)
progs/hashsum.c (checkhash): Fix stupid bugs.
author
Mark Wooding
<mdw@distorted.org.uk>
Sat, 5 Jul 2014 01:09:05 +0000
(
02:09
+0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Sat, 5 Jul 2014 01:13:37 +0000
(
02:13
+0100)
* Initialize the return code. Not sure why this didn't get a warning.
* Pick up changes of hash function properly.
progs/hashsum.c
patch
|
blob
|
blame
|
history
diff --git
a/progs/hashsum.c
b/progs/hashsum.c
index 8cc19265fd31c18047ecfd09b89a5ec60d4fb99b..df1fdaea5f21cf147b8d7f02657b733a6390802c 100644
(file)
--- 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)) {