replace size_s with ptrdiff_t