Replace size_t with pointer in reading array in reverse since size_t is unsigned and is unsafe on underflow.