Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#277 - lemonrock:strnlen, r=alexcrichton
Added strnlen function to all platforms. strnlen is used to find the length of a C string that may be lacking a terminal NUL character. Whilst it is possible to implement the equivalent functionality in rust code, it is cleaner, simpler and removes the need for duplication of tricky functionality to get right. It also makes it easier to port C code snippets to rust. In my case, it's needed for dealing with the result of `gethostname`. Note that strnlen is not part of POSIX or C99, but is present on all major platforms.
- Loading branch information