"%d" can't be used for size_t which may be of greater size than int, so use "%lu" with a cast to unsigned long, as is done elsewhere because "%z" is unfortunately not portable. Closes #17255.