File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -445,9 +445,8 @@ prefer using raw pointers (`*`) if that's needed because the compiler can't make
445
445
about them.
446
446
447
447
Vectors and strings share the same basic memory layout, and utilities are available in the ` vec ` and
448
- ` str ` modules for working with C APIs. Strings are terminated with ` \0 ` for interoperability with C,
449
- but it should not be assumed because a slice will not always be nul-terminated. Instead, the
450
- ` str::as_c_str ` function should be used.
448
+ ` str ` modules for working with C APIs. However, strings are not terminated with ` \0 ` . If you need a
449
+ NUL-terminated string for interoperability with C, you should use the ` c_str::to_c_str ` function.
451
450
452
451
The standard library includes type aliases and function definitions for the C standard library in
453
452
the ` libc ` module, and Rust links against ` libc ` and ` libm ` by default.
You can’t perform that action at this time.
0 commit comments