X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fbuckettool.c;h=76b8fc37c21f5586074490981ecee352eefbf23a;hb=e828732528e0ed88973dd18f2dee97a42c0b4e59;hp=f22f17f90691e53ab164dfb97970f99710fc570b;hpb=3b44cc5e0858a329f647bee0617fbab117ea5ea9;p=libucw.git diff --git a/lib/buckettool.c b/lib/buckettool.c index f22f17f9..76b8fc37 100644 --- a/lib/buckettool.c +++ b/lib/buckettool.c @@ -13,7 +13,7 @@ #include "lib/fastbuf.h" #include "lib/lfs.h" #include "lib/conf.h" -#include "lib/pools.h" +#include "lib/mempool.h" #include "lib/object.h" #include "lib/lizard.h" #include "lib/bbuf.h" @@ -156,6 +156,8 @@ insert(byte *arg) type = BUCKET_TYPE_PLAIN; else if (sscanf(arg, "%x", &type) != 1) die("Type `%s' is not a hexadecimal number"); + if (type < 10) + type += BUCKET_TYPE_PLAIN; attr_set_type(type); in = bfdopen_shared(0, 4096); @@ -199,6 +201,11 @@ insert(byte *arg) bputl(b, lizard_filled #if 0 //TEST error resilience: write wrong length +1 +#endif + ); + bputl(b, adler32(lizard_buf.ptr, lizard_filled) +#if 0 //TEST error resilience: write wrong checksum + +1 #endif ); uns want_len = lizard_filled * LIZARD_MAX_MULTIPLY + LIZARD_MAX_ADD; @@ -247,6 +254,7 @@ cat(void) } else dump_parsed_bucket(out, &h, b); + bputc(out, '\n'); } bclose(out); obuck_cleanup();