Skip to content

Commit 96954c4

Browse files
committed
fixed missing zero in os_string_nil
1 parent 564591a commit 96954c4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

native_api_1c_core/src/ffi/string_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub unsafe fn get_str<'a>(s: *const u16) -> &'a [u16] {
2727
/// `Vec<u16>` - UTF-16 string without null terminator
2828
#[cfg(target_family = "unix")]
2929
pub fn os_string_nil(s: &str) -> Vec<u16> {
30-
s.encode_utf16().collect()
30+
s.encode_utf16().chain(Some(0)).collect()
3131
}
3232

3333
/// Helper function to convert Rust string to UTF-16 string

0 commit comments

Comments
 (0)