buf_size: add support for strndup()