iAdd an explicit check for unsupported algos to make the error obvious - dedup - deduplicating backup program Err bitreich.org 70 hgit clone git://bitreich.org/dedup/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/dedup/ URL:git://bitreich.org/dedup/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/dedup/ bitreich.org 70 1Log /scm/dedup/log.gph bitreich.org 70 1Files /scm/dedup/files.gph bitreich.org 70 1Refs /scm/dedup/refs.gph bitreich.org 70 1Tags /scm/dedup/tag bitreich.org 70 1README /scm/dedup/file/README.gph bitreich.org 70 1LICENSE /scm/dedup/file/LICENSE.gph bitreich.org 70 i--- Err bitreich.org 70 1commit 874e674f9ffc61d83ff6e756d9749d4ae9d1129b /scm/dedup/commit/874e674f9ffc61d83ff6e756d9749d4ae9d1129b.gph bitreich.org 70 1parent 738efabad162925277a2e7bb809ea127fd75d497 /scm/dedup/commit/738efabad162925277a2e7bb809ea127fd75d497.gph bitreich.org 70 hAuthor: sin URL:mailto:sin@2f30.org bitreich.org 70 iDate: Wed, 10 Apr 2019 13:52:45 +0100 Err bitreich.org 70 i Err bitreich.org 70 iAdd an explicit check for unsupported algos to make the error obvious Err bitreich.org 70 i Err bitreich.org 70 iDiffstat: Err bitreich.org 70 i M dedup.c | 6 ++++++ Err bitreich.org 70 i Err bitreich.org 70 i1 file changed, 6 insertions(+), 0 deletions(-) Err bitreich.org 70 i--- Err bitreich.org 70 1diff --git a/dedup.c b/dedup.c /scm/dedup/file/dedup.c.gph bitreich.org 70 i@@ -470,9 +470,15 @@ load_blk_hdr(void) Err bitreich.org 70 i v &= COMPR_ALGO_MASK; Err bitreich.org 70 i compr_algo = v; Err bitreich.org 70 i Err bitreich.org 70 i+ if (compr_algo < 0 || compr_algo >= NR_COMPRS) Err bitreich.org 70 i+ errx(1, "unsupported compression algorithm :%d", compr_algo); Err bitreich.org 70 i+ Err bitreich.org 70 i v = blk_hdr.flags >> HASH_ALGO_SHIFT; Err bitreich.org 70 i v &= HASH_ALGO_MASK; Err bitreich.org 70 i hash_algo = v; Err bitreich.org 70 i+ Err bitreich.org 70 i+ if (hash_algo < 0 || hash_algo >= NR_HASHES) Err bitreich.org 70 i+ errx(1, "unsupported hash algorithm :%d", hash_algo); Err bitreich.org 70 i } Err bitreich.org 70 i Err bitreich.org 70 i static void Err bitreich.org 70 .