Source
static void resolve_opdata(const zbx_db_event *event, char **replace_to, const char *tz, char *error, int maxerrlen)
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/******************************************************************************
* *
* Purpose: formats full user name from name, surname and alias. *
* *
* Parameters: name - [IN] user name, can be empty string *
* surname - [IN] user surname, can be empty string *
* alias - [IN] user alias *
* *
* Return value: the formatted user fullname. *
* *
******************************************************************************/
static char *format_user_fullname(const char *name, const char *surname, const char *alias)
{
char *buf = NULL;
size_t buf_alloc = 0, buf_offset = 0;
zbx_strcpy_alloc(&buf, &buf_alloc, &buf_offset, name);
if ('\0' != *surname)
{
if (0 != buf_offset)
zbx_chrcpy_alloc(&buf, &buf_alloc, &buf_offset, ' ');
zbx_strcpy_alloc(&buf, &buf_alloc, &buf_offset, surname);
}
if ('\0' != *alias)
{