On 04/08/2012 09:38 AM, skr...@hushmail.com wrote: > I am trying to use the bzip2 library like so to compress the buffer. > > char *cbuf=malloc(sizeof(*buf)); > size_t cbuf_size=0; > int > ret=BZ2_bzBuffToBuffCompress(cbuf,&cbuf_size,buf,(size_t)strlen(buf),9,4,30); > printf("COMPRESSED MSG:\nRETURN VALUE: %d\nORIGINAL > SIZE:%d\nDATA:%s\nCOMPRESS > SIZE:%d\nDATA:%s\m",ret,strlen(buf),buf,cbuf_size,cbuf); > free(cbuf); > > It always returns a -8 anyone know what I am doing wrong here?
You probably need to set destLen (cbuf_size) to the size of dest (cbuf) to provide the upper limit. -- ________________________________________________________________ Paul J Stevens pjstevns @ gmail, twitter, skype, linkedin * Premium Hosting Services and Web Application Consultancy * www.nfg.nl/i...@nfg.nl/+31.85.877.99.97 ________________________________________________________________ _______________________________________________ Dbmail-dev mailing list Dbmail-dev@dbmail.org http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail-dev