+ if (action != 't')
+ {
+ struct fastbuf *fo = bopen(argv[optind+1], O_CREAT | O_TRUNC | O_WRONLY, 1<<16);
+ if (action == 'c')
+ {
+ bputl(fo, li);
+ bputl(fo, adler32(mi, li));
+ }
+ bwrite(fo, mo, lo);
+ bclose(fo);
+ }
+ else
+ {
+ int smaller_li;
+ if (li >= (int) CPU_PAGE_SIZE)
+ smaller_li = li - CPU_PAGE_SIZE;
+ else
+ smaller_li = 0;
+ 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");
+ lizard_free(buf);
+ }
+ printf("\n");