Added cast to size_t of read offset

Avoids -Wsign-compare warning