I am trying to use zlib library to use it in a string compression application. Look at the piece of code --
uLongf DestBuffSize=0; compress2((Bytef*)CompDataBuff, (uLongf*)&DestBuffSize,(const Bytef*)d1, (uLongf)length, Z_BEST_COMPRESSION);
In this code the variable DestBuffSize will contain the length of the compressed buffer.
But the variable DestBuffSize is not containing the size of the compressed buffer. when looking at the value of DestBuffSize after the execution of this function.