You can use talloc_array_length() to get the length of a tallocated array.
Attach a file by drag & drop or click to upload