Source
zbx_variant_set_error(value, zbx_dsprintf(NULL, "cannot convert value \"%s\" from %s to decimal format: %s",
/*
** 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.
**/
/******************************************************************************
* *
* Purpose: execute 'multiply by' step *
* *
* Parameters: value_type - [IN] item value type *
* value - [IN/OUT] input/output value *
* params - [IN] preprocessing parameters *
* *
* Result value: SUCCEED - the preprocessing step was executed successfully. *
* FAIL - otherwise. The error message is stored in value. *
* *
******************************************************************************/
static int pp_execute_multiply(unsigned char value_type, zbx_variant_t *value, const char *params)
{
char buffer[MAX_STRING_LEN], *error = NULL, *errmsg = NULL;
zbx_strlcpy(buffer, params, sizeof(buffer));
zbx_trim_float(buffer);
if (FAIL == zbx_is_double(buffer, NULL))
{
error = zbx_dsprintf(NULL, "a numerical value is expected or the value is out of range");
}
else if (SUCCEED == item_preproc_multiplier_variant(value_type, value, buffer, &errmsg))