.......PS. [ZBX-7729] added check to avoid declaring zero length array. Formatted comments.