implemented safe_readv/safe_writev, fixed bug in format_string