consistently use time_t and size_t