Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src/templ.rs: fix handling of C string slices
CommandLineParser is currently misbehaving due to improper data in its input argv parameter. The problem is caused by a blind cast of argv entries from &str into a C-like string, which does not offer the null termination guarantees. To fix that, create an actual CString and hold it while the pointer is in use. It's worth noting that the mutable version of the macro still relies on undefined behavior, but this time of CString which does not guarantee correctness if its data is written into.
- Loading branch information