.......PS. [ZBX-8287] adjusted a bit of style: we do not use blocks for switch cases and it is better to initialize str_alloc and str_offset in the same manner as elsewhere, because zbx_strncpy_alloc() is a low-level function whose implementation might change later