Menu

#4 ZLibcompr function always returns me buf

open
nobody
None
5
2002-08-10
2002-08-10
Anonymous
No

Following are the snap of the code.

if (ZLSetup)
{
char dest[100];
char result[100];
uLongf destLen = 100;

char source[] = "a string to compress";
int err;
uLongf sourceLen = strlen(source) + 1;

err = ZLibcompress2(ZLibRef, (Bytef *)dest, &destLen,
(Bytef *)source,
sourceLen, Z_DEFAULT_COMPRESSION);

ULong lUncompLen = 100;
err = ZLibuncompress(ZLibRef,(Bytef *)result,
&lUncompLen,
(const Bytef *)dest, destLen);
}

but ZLibcompress2 always returns Z_BUF_ERROR
regardless of the destination
buffer size.

Discussion


Log in to post a comment.