X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Flizard-test.c;h=ba78e022cadd28ac52d404c31e45a921dab0f302;hb=997624f88f37bec5cb96cf9fc3b3cac05ccc6ed8;hp=0b8c95290b1c317da0ff5ecf7fd4f9a0b1697687;hpb=da73e286d4f7a69184cd673db622333d16d2775c;p=libucw.git diff --git a/lib/lizard-test.c b/lib/lizard-test.c index 0b8c9529..ba78e022 100644 --- a/lib/lizard-test.c +++ b/lib/lizard-test.c @@ -17,7 +17,7 @@ CF_USAGE "-c\t\tCompress\n\ -d\t\tDecompress\n\ -t\t\tCompress, decompress, and compare (in memory only, default)\n\ --x, -xx\t\tLet the test crash by shrinking the output buffer\n\ +-x\t\tLet the test crash by shrinking the output buffer\n\ "; static void NONRET @@ -100,13 +100,11 @@ main(int argc, char **argv) smaller_li = li - PAGE_SIZE; else smaller_li = 0; - struct lizard_buffer *buf = lizard_alloc(crash==1 ? smaller_li : li); - int lv = lizard_decompress_safe(mo, buf, crash==2 ? smaller_li : li); - printf("-> %d ", lv); - fflush(stdout); - if (lv < 0) - printf("err:%m "); - else if (lv != li || memcmp(mi, buf->ptr, li)) + struct lizard_buffer *buf = lizard_alloc(); + byte *ptr = lizard_decompress_safe(mo, buf, crash ? smaller_li : li); + if (!ptr) + printf("err: %m"); + else if (memcmp(mi, ptr, li)) printf("WRONG"); else printf("OK");