buf_size: given and array and an offset then return the remaining size