Source
if (Z_OK != (zbx_zlib_errno = uncompress((Bytef *)out, &size_o, (const Bytef *)in, size_in)))
/*
** Zabbix
** Copyright (C) 2001-2023 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
static int zbx_zlib_errno = 0;
/******************************************************************************
* *
* Purpose: returns last conversion error message *
* *
******************************************************************************/
const char *zbx_compress_strerror(void)
{
static char message[ZBX_COMPRESS_STRERROR_LEN];
switch (zbx_zlib_errno)
{
case Z_ERRNO:
zbx_strlcpy(message, zbx_strerror(errno), sizeof(message));
break;
case Z_MEM_ERROR:
zbx_strlcpy(message, "not enough memory", sizeof(message));
break;
case Z_BUF_ERROR:
zbx_strlcpy(message, "not enough space in output buffer", sizeof(message));
break;
case Z_DATA_ERROR:
zbx_strlcpy(message, "corrupted input data", sizeof(message));
break;
default:
zbx_snprintf(message, sizeof(message), "unknown error (%d)", zbx_zlib_errno);
break;
}
return message;
}
/******************************************************************************