tRevert "Fold checks into one" - dedup - deduplicating backup program
(HTM) git clone git://git.z3bra.org/dedup.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit fecf79960e6acd97640b944b9b7d653e5c2b5a52
(DIR) parent 5064abfd02125645e6099f376feca283e1edd745
(HTM) Author: sin <sin@2f30.org>
Date: Thu, 16 May 2019 12:39:42 +0100
Revert "Fold checks into one"
This reverts commit 5064abfd02125645e6099f376feca283e1edd745.
Diffstat:
M block.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/block.c b/block.c
t@@ -147,13 +147,20 @@ bcheck(struct bctx *bctx, unsigned char *md)
}
n = BSIZEMAX;
- if (bcompressops()->get(bctx, md, buf, &n) < 0 ||
- bhash(buf, n, tmp) < 0 ||
- memcmp(tmp, md, MDSIZE) != 0) {
+ if (bcompressops()->get(bctx, md, buf, &n) < 0) {
free(buf);
return -1;
}
+ if (bhash(buf, n, tmp) < 0) {
+ free(buf);
+ return -1;
+ }
+
+ if (memcmp(tmp, md, MDSIZE) != 0) {
+ free(buf);
+ return -1;
+ }
free(buf);
return 0;
}