X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=ossec-hids.git;a=blobdiff_plain;f=src%2Fos_zlib%2Fos_zlib.c;fp=src%2Fos_zlib%2Fos_zlib.c;h=5caf680573bcbd88651329815847498f07c48106;hp=18829acfc3684f658e1be29a2e708d7cae934013;hb=3f728675941dc69d4e544d3a880a56240a6e394a;hpb=927951d1c1ad45ba9e7325f07d996154a91c911b diff --git a/src/os_zlib/os_zlib.c b/src/os_zlib/os_zlib.c old mode 100755 new mode 100644 index 18829ac..5caf680 --- a/src/os_zlib/os_zlib.c +++ b/src/os_zlib/os_zlib.c @@ -9,37 +9,40 @@ #include "os_zlib.h" -unsigned long int os_zlib_compress(const char *src, char *dst, unsigned long int src_size, - unsigned long int dst_size) +#ifdef ZLIB_SYSTEM +#include +#else +#include "../external/zlib-1.2.11/zlib.h" +#endif + +unsigned long int os_zlib_compress(const char *src, char *dst, + unsigned long int src_size, + unsigned long int dst_size) { - if(compress2((Bytef *)dst, - &dst_size, - (const Bytef *)src, - src_size, - Z_BEST_COMPRESSION) == Z_OK) - { + if (compress2((Bytef *)dst, + &dst_size, + (const Bytef *)src, + src_size, + Z_BEST_COMPRESSION) == Z_OK) { dst[dst_size] = '\0'; - return(dst_size); + return (dst_size); } - return(0); + return (0); } - -unsigned long int os_zlib_uncompress(const char *src, char *dst, unsigned long int src_size, - unsigned long int dst_size) +unsigned long int os_zlib_uncompress(const char *src, char *dst, + unsigned long int src_size, + unsigned long int dst_size) { - if(uncompress((Bytef *)dst, - &dst_size, - (const Bytef *)src, - src_size) == Z_OK) - { + if (uncompress((Bytef *)dst, + &dst_size, + (const Bytef *)src, + src_size) == Z_OK) { dst[dst_size] = '\0'; - return(dst_size); + return (dst_size); } - return(0); + return (0); } - -/* EOF */