]> git.lizzy.rs Git - rust.git/commit
Check for interior nulls in .to_c_str()
authorKevin Ballard <kevin@sb.org>
Thu, 15 Aug 2013 02:19:29 +0000 (19:19 -0700)
committerKevin Ballard <kevin@sb.org>
Thu, 15 Aug 2013 08:32:10 +0000 (01:32 -0700)
commit48265b779fabf865a4b05f000ea1575c90e3cd73
tree70e4fc83ed145142c5f7b53440e2ff7f9181ad29
parent1e4f13f95fc629bcee2ad9a766d9af7c7b2e18f7
Check for interior nulls in .to_c_str()

Previous dicussions about CString suggested that interior nulls should
throw an error. This was never implemented. Add this now, using a
condition (named null_byte) to allow for recovery.

Add method .to_c_str_unchecked() that skips this check.
src/libstd/c_str.rs
src/libstd/path.rs